0

I have just discovered a problem that I don't understand (SLES15 SP2):

I had mis-configured one logrotate service (in /etc/logrotate.d). In SLES 15 logrotate.service is triggered by logrotate.timer daily.

However my mis-configured service seems to log an error message only once (which was the main reason I did not discover the problem for a long time).

Can anybody explain what is going on? Other logrotate services seem to be executed (I'm not sure).

Some Details

The error from logrotate was caused by a failed postrotate action, specifically the failure to send SIGHUP to the running process.

Syslog messages:

Dec 18 00:00:20 h16 systemd[1]: Starting Rotate log files...
Dec 18 00:00:20 h16 logrotate[41799]: Failed to kill unit \x7b__SERVICE__\x7d.service: Unit \x7b__SERVICE__\x7d.service is not loaded.
Dec 18 00:00:20 h16 logrotate[41799]: error: error running shared postrotate script for '/var/log/iotwatch/MD10/*.log '
Dec 18 00:00:20 h16 systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE
Dec 18 00:00:20 h16 systemd[1]: Failed to start Rotate log files.
Dec 18 00:00:20 h16 systemd[1]: logrotate.service: Unit entered failed state.
Dec 18 00:00:20 h16 systemd[1]: logrotate.service: Failed with result 'exit-code'.

1 Answer 1

0

It seems I was confused about the absence of further error messages, assuming that would be caused by logrotate no longer executing.

However when the postrotate action failed, it meant that the old logfile was renamed, but (due to the failure in postrotate) the daemon continued to write into the renamed file (instead of being triggered by postrotate to create a new one to write to).

In turn that meant that logrotate would not find a logfile to rotate, which consequently also meant that no postrotate action was to be executed. So finally when no postrotate is executed, it cannot trigger an error, so no messages in syslog.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .