I upgraded logrotate to 3.8.4 on 6/21/2013. On 6/23/2013 my logs in the syslog-ng configuration rotated, but syslot-ng was not reloaded, as specified by the postrotate (with sharedscripts) section of the /etc/logrotate.d/syslog-ng file. Unfortunately, I didn't notice this until today.
After a lot of debugging, I determined that the problem is that the postrotate section was not executing if the first log in the configuration was missing. Missing logs after the initial did not affect the postrotate command.
Steps to Reproduce:
1. Create a logrotate conf file with a missing first log with sharedscripts and postrotate commands.
2. Run: logrotate -d --force /etc/logrotate.conf
3. Observe that the postrotate command does not appear in the output
Postrotate command is not executed, and in my case, syslog-ng is not reloaded which does not write to the new log files.
postrotate command should execute.
Please see attached configuration and output files.
Created attachment 352866 [details]
syslog-ng broken logrotate configuration file
Created attachment 352868 [details]
syslog-ng working logrotate configuration file
Created attachment 352870 [details]
Output of logrotate with broken syslog-ng config file.
Created attachment 352872 [details]
Output of logrotate with working syslog-ng config file.
Note: I moved all other logrotate.d/* files into a temporary folder at /etc/logrotate.d/tmp so that the debugging output was more focused.
Thanks for reporting.
Upstream bug filed:
Error also occurs if first log file is not rotated.
Upstream has released a fix . Works for me, can you test it?
Works for me also. Anyone posting the results upstream?
Yes, upstream is updated.
Closing bug. Thanks.
*** Bug 492806 has been marked as a duplicate of this bug. ***