Skip to content

Commit

Permalink
logrotate: Don't fail when syslog not running
Browse files Browse the repository at this point in the history
Avoid error

    logrotate[225]: dateext suffix '.2019-10'
    logrotate[225]: glob pattern '.[0-9][0-9][0-9][0-9]-[0-9][0-9]'
    logrotate[225]: renaming /var/log/messages to /var/log/messages.2019-10
    logrotate[225]: running postrotate script
    logrotate[225]: cat: /var/run/rsyslogd.pid: No such file or directory
    logrotate[225]: kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... o
    logrotate[225]: error: error running shared postrotate script for '/var/log/messages '
    systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE
    systemd[1]: logrotate.service: Failed with result 'exit-code'.
    systemd[1]: Failed to start Rotate log files.
  • Loading branch information
donald committed Oct 17, 2019
1 parent 302944b commit 6a71b43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion logrotate/logrotate.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
monthly
sharedscripts
postrotate
kill -HUP $(cat /var/run/rsyslogd.pid)
kill -HUP $(cat /var/run/rsyslogd.pid) || true
endscript
}

0 comments on commit 6a71b43

Please sign in to comment.