Today we will see an interesting issue where the logs are collected in /var/adm/messages as per rsyslog.conf.
However the log file size in increasing infinitely and is not rotating.
It caused issue with disk space on /var filesystem.
First lets check out rsyslog.conf file settings:
# cat /etc/rsyslog.conf # ### end of the forwarding rule ### auth.info /var/adm/auth.log #*.crit added by /SE/vcontrol/scripts/standardise_logging_V10.sh at Thu Aug 23 11:39:30 BST 2018 *.crit /var/adm/messages #daemon.warning added by /SE/vcontrol/scripts/standardise_logging_V10.sh at Thu Aug 23 11:39:30 BST 2018 daemon.warning /var/adm/messages
/var/adm/messages and auth.log file not rotating.
2. Root Cause:
The log files /var/adm/messages and auth.log are not added in log rotation. /var/log/messages was added and is rotating as per configuration.
Need to add below two lines in /etc/logrotate.d/syslog file as first two lines: /var/adm/messages /var/adm/auth.log
4. Test the changes:
# kill -HUP `cat /var/run/syslogd.pid` // It should rotate the file immediately.