I am running puppet 3.2.1, using the puppetlabs repos, on centos 6.4. I keep getting these messages in the log: (every 30 minutes)Jun 3 11:24:55 yoda puppet-master[20292]: Failed to set SELinux context system_u:object_r:puppet_etc_t:s0 on /etc/puppet/auth.confJun 3 11:24:55 yoda puppet-master[20292]: Failed to set SELinux context system_u:object_r:puppet_etc_t:s0 on /etc/puppet/manifests/site.ppJun 3 11:24:55 yoda puppet-master[20292]: Starting Puppet master version 3.2.1Currently, selinux is running in permissive mode, and the actual selinux context for these files is:-rw-r--r--. root root unconfined_u:object_r:puppet_etc_t:s0 auth.conf-rw-r--r--. root root system_u:object_r:puppet_etc_t:s0 auth.conf.rpmnew-rw-r--r--. root root system_u:object_r:puppet_etc_t:s0 fileserver.confdrwxr-xr-x. root root system_u:object_r:puppet_etc_t:s0 manifestsdrwxr-xr-x. root root system_u:object_r:puppet_etc_t:s0 modules-rw-r--r--. root root unconfined_u:object_r:puppet_etc_t:s0 puppet.confrestorecon sets all files in the subdirectories to unconfined_u. puppet master runs as root, so it should be able to modify the file labels.
Anyone have any idea why these messages keep popping up? and how to fix the problem? Admittedly, I can just change the file labels manually, but that doesn't solve the underlying problem.
It's not the cause of your problem, but the master should NOT run as root. There is no reason why it should need special privilege to do its work, therefore good security practices dictate that it run without such privilege.
If restorecon sets the SELinux labels incorrectly, however, then you need to teach it what the correct labels ought to be. It is a fundamental problem for restorecon to disagree with Puppet about what the labels should be.
I also find it a little strange that you see those messages repeatedly, and especially that you see them at 30-minute intervals. Are you running the master standalone, or via apache/passenger (or some other rack server)? If the latter, then the rack server may be starting new master instances periodically, and in that case they might not be running with the identity and privileges you think.
Anyone have any idea why these messages keep popping up? and how to fix the problem? Admittedly, I can just change the file labels manually, but that doesn't solve the underlying problem.
You should try updating your selinux policy package to the latest available. You may need to manually modify your policy, however, as there were puppet-related bugs in some of the policy packages at least as recently as Fedora 18, which doesn't bode well for CentOS / RHEL 6.4. See, for example, https://bugzilla.redhat.com/show_bug.cgi?id=848939.
John