Reputation: 1606
My rsyslog logrotate config file is -
/home/user/logs/*.l {
daily
postrotate
reload rsyslog >/dev/null 2>&1 || true
endscript
}
The file is rotating properly but the logs are going into the old log file. The issue gets resolved when I manually restart rsyslog.
I'm running this on CentOS.
Upvotes: 2
Views: 6360
Reputation: 1
restart service is not recommended for it could lose log. I resolve this problem with: 1. killall -HUP rsyslogd 2. kill -HUP $(cat /var/run/rsyslogd.pid)
the pid filename may be syslogd.pid. HUP lets rsyslogd perform close all open files according to man page.
Upvotes: 0
Reputation: 436
reload syslog
didn't work for me, either. I used service rsyslog restart
instead.
Upvotes: 4
Reputation: 1606
In the end it was resolved with compress daily instead of rotate. For some reason, it wasn't working on CentOS6.4
Upvotes: 0