sonic-buildimage/files/image_config/logrotate.d/rsyslog
Joe LeVeque f28790ce9a [System logs]: Fix logrotate bugs (#535)
- rsyslog logs were being rotated regardless of whether they exceeded their maixmum size. This was due to "-f" flag passed to logrotate in cron job.

- After rotation, /var/log/syslog was never written to again. Instead, logs were written to /var/log/syslog.1. This was due to rsyslog not properly closing the file descriptor to the pre-rotated log.

- Also brought back time-related rotation via the new(er) maxsize option, which performs a boolean OR operation. If the log exceeds the maxsize OR the log hasn't been rotated in the specified, it will be rotated. Using the older size option, the time-based rotation was ignored.

- Also addresses issue #528
2017-04-24 17:55:05 -07:00

50 lines
1.2 KiB
Plaintext

/var/log/syslog
/var/log/quagga/*.log
/var/log/teamd.log
{
rotate 7
daily
maxsize 100M
missingok
notifempty
compress
delaycompress
postrotate
# Calling kill directly instead of 'service rsyslog rotate >/dev/null' due
# to bug in init-system-helpers. Bug has apparently been fixed in v1.47.
# However, Debian Jessie is still using v1.22.
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672218
kill -HUP $(cat /var/run/rsyslogd.pid)
endscript
}
/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log
/var/log/daemon.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/lpr.log
/var/log/cron.log
/var/log/debug
/var/log/messages
{
rotate 4
weekly
maxsize 100M
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
# Calling kill directly instead of 'service rsyslog rotate >/dev/null' due
# to bug in init-system-helpers. Bug has apparently been fixed in v1.47.
# However, Debian Jessie is still using v1.22.
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672218
kill -HUP $(cat /var/run/rsyslogd.pid)
endscript
}