What causes this logrotate behavior in Puppet?
Posted
by
ujjain
on Server Fault
See other posts from Server Fault
or by ujjain
Published on 2013-07-01T07:54:34Z
Indexed on
2013/07/01
10:23 UTC
Read the original article
Hit count: 553
After running logrotate, Puppet starts writing it's logs into /var/log/puppet/masterhttp.log-20130616. How come it doesn't keep logging in /var/log/puppet/masterhttp.log?
It seems normal behavior is renaming the original log-file and start with a clean fresh log-file to start writing in that log file, keeping the other file as a log-archive.
[root@puppetmaster puppet]# ls -al
total 97520
drwxr-x---. 2 puppet puppet 4096 Jun 16 03:24 .
drwxr-xr-x. 12 root root 4096 Jul 1 09:11 ..
-rw-r--r--. 1 puppet puppet 0 Jun 16 03:24 masterhttp.log
-rw-rw----. 1 puppet puppet 99847187 Jul 1 09:19 masterhttp.log-20130616
[root@puppetmaster init.d]# cat /etc/logrotate.d/puppet
/var/log/puppet/*log {
missingok
notifempty
create 0644 puppet puppet
sharedscripts
postrotate
pkill -USR2 -u puppet -f /usr/sbin/puppetmasterd || true
[ -e /etc/init.d/puppet ] && /etc/init.d/puppet reload > /dev/null 2>&1 || true
endscript
}
[root@puppetmaster init.d]#
How can I make Puppet log to /var/log/puppet/masterhttp.log and not to /var/log/puppet/masterhttp.log-20130616?
Even restarting puppet doesn't make it log into /var/log/puppet/masterhttp.log instead of /var/log/puppet/masterhttp.log-20130616.
© Server Fault or respective owner