It is time to clean up the confusing log rotating set-up on our Ubuntu servers.
Currently log rotating is done through syslog and logrotate. We will kill the syslog stuff, and use logrotate for rotating all logs.
Sysklogd will be just another process that needs to have its logs rotated by logrotate.
- Generate logrotate config file for sysklogd. You can ask sysklogd what files it is currently logging to, and use that as input for the logrotate config file.
This ugly one liner will do the trick:Change according to your needs - defaults are inecho -e "`printf \\"\"%s\\" \" \`syslogd-listfiles -a\`` {\n\tpostrotate\nsharedscripts\n\t\t/etc/init.d/sysklogd reload > /dev/null\n\tendscript\n}\n" > /etc/logrotate.d/sysklogd
/etc/logrotate.conf
- see man logrotate. Very useful option isdateext
. - Remove old sysklogd cron entries:
rm /etc/cron.*/sysklogd
This /should/ to the trick. Testing now on Cajones.