In the end it was resolved with compress daily instead of rotate. For some reason, it wasn't working on CentOS6.4
Rsyslog writing to old file after logrotate
Frage
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.
Lösung 2
Andere Tipps
reload syslog
didn't work for me, either. I used service rsyslog restart
instead.
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.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow