Issue #13914 has been updated by Brian Pitts.

Short version: puppetmasterd creates the log file with root ownership, but it 
should be owned by puppet.

Long version:

I collected the information I filed in this issue on the same day that I tried 
and failed to get the master logging to a file. When I couldn't get that 
working, I switched back to syslog. One piece of information I collected was 
that master.log was owned by the root user.

Since then, logrotate ran. It renamed master.log to master.log.1 and recreated 
master.log. When creating master.log, it gave ownership to the puppet user, as 
specified in /etc/logrotate.d/puppet.

Now that master.log exists and is owned by puppet, if I run `puppetmasterd 
--logdest /var/log/puppet/master.log` the log messages are now being written to 
that file.

If I stop puppetmasterd, delete master.log, and then start puppetmasterd, 
master.log is owned by root and is missing the log messages again.
----------------------------------------
Bug #13914: Puppet master not logging to file 
https://projects.puppetlabs.com/issues/13914#change-60811

Author: Brian Pitts
Status: Needs More Information
Priority: Normal
Assignee: Brian Pitts
Category: 
Target version: 
Affected Puppet version: 2.7.12
Keywords: 
Branch: 


I'm running puppet 2.7.12 on CentOS 5.8. I'm having trouble getting the
puppet master to log to a file. The same configuration is working fine
for the puppet agent. A single line is written to the master's log file
when it starts. When logging to syslog or the console, I get lots of
output each time an agent talks to the master. When logging to a file, I
get nothing. The master does not even appear to have the log file open.
Below is my configuration and some shell output demonstrating the
problem.

`$ egrep -v '#|^$' puppet.conf`
<pre>
[main]
     vardir = /var/lib/puppet
     logdir = /var/log/puppet
     rundir = /var/run/puppet
     ssldir = $vardir/ssl
     pluginsync = true
     factpath = $vardir/lib/facter
     autoflush = true
[agent]
     server =  redacted
     classfile = $vardir/classes.txt
     localconfig = $vardir/localconfig
     listen = false
[master]
     modulepath = redacted
     storeconfigs = true
     dbadapter = sqlite3
     dblocation = $vardir/storeconfigs.sqlite
     certname = redacted
</pre>

`$ egrep -v '#|^$' /etc/sysconfig/puppet`
<pre>
PUPPET_LOG=/var/log/puppet/agent.log
PUPPET_EXTRA_OPTS=--verbose
</pre>

`$ egrep -v '#|^$' /etc/sysconfig/puppetmaster`
<pre>
PUPPETMASTER_LOG=/var/log/puppet/master.log
PUPPETMASTER_EXTRA_OPTS=--verbose
</pre>

`$ ps -wwfp $(pgrep -fd, puppet)`
<pre>
UID        PID  PPID  C STIME TTY          TIME CMD
root     12566     1  6 18:33 ?        00:00:53 /usr/bin/ruby
/usr/sbin/puppetd --logdest=/var/log/puppet/agent.log --verbose
puppet   15612     1  5 18:43 ?        00:00:15 /usr/bin/ruby
/usr/sbin/puppetmasterd --logdest /var/log/puppet/master.log --verbose
</pre>

`$ sudo pkill -SIGUSR1 puppetd`

`$ sudo ls -lt /var/log/puppet/`
<pre>
total 25136
-rw-rw---- 1 puppet puppet 25661723 Apr  6 18:51 masterhttp.log
-rw-r--r-- 1 root   root      21638 Apr  6 18:51 agent.log
-rw------- 1 puppet puppet     3889 Apr  6 18:44 rails.log
-rw-r--r-- 1 root   root         68 Apr  6 18:43 master.log
-rw-r----- 1 root   root       4850 Apr  4 17:02 http.log
</pre>

`$ sudo cat /var/log/puppet/master.log`
<pre>
Fri Apr 06 18:43:43 -0400 2012 Puppet (notice): Reopening log files
</pre>

`$ sudo tail -n 1 /var/log/puppet/agent.log`
<pre>
Fri Apr 06 18:51:47 -0400 2012 Puppet (notice): Finished catalog run in
11.73 seconds
</pre>

`$ sudo fuser -s /var/log/puppet/agent.log; echo $?`
<pre>0</pre>

`$ sudo fuser -s /var/log/puppet/master.log; echo $?`
<pre>1</pre>



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to