Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 476202

Summary: =app-admin/logrotate-3.8.4 - sharedscripts postrotate does not execute if first log is missing
Product: Gentoo Linux Reporter: Adam Randall <randalla>
Component: Current packagesAssignee: Chema Alonso Josa (RETIRED) <nimiux>
Status: RESOLVED UPSTREAM    
Severity: normal CC: alois.schmid, daniel, manjiki, randalla, tesoro302
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://fedorahosted.org/logrotate/ticket/32
See Also: https://bugs.gentoo.org/show_bug.cgi?id=476720
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: syslog-ng broken logrotate configuration file
syslog-ng working logrotate configuration file
Output of logrotate with broken syslog-ng config file.
Output of logrotate with working syslog-ng config file.

Description Adam Randall 2013-07-08 17:09:19 UTC
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.

Reproducible: Always

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
Actual Results:  
Postrotate command is not executed, and in my case, syslog-ng is not reloaded which does not write to the new log files.

Expected Results:  
postrotate command should execute.

Please see attached configuration and output files.
Comment 1 Adam Randall 2013-07-08 17:10:04 UTC
Created attachment 352866 [details]
syslog-ng broken logrotate configuration file
Comment 2 Adam Randall 2013-07-08 17:10:37 UTC
Created attachment 352868 [details]
syslog-ng working logrotate configuration file
Comment 3 Adam Randall 2013-07-08 17:11:12 UTC
Created attachment 352870 [details]
Output of logrotate with broken syslog-ng config file.
Comment 4 Adam Randall 2013-07-08 17:11:32 UTC
Created attachment 352872 [details]
Output of logrotate with working syslog-ng config file.
Comment 5 Adam Randall 2013-07-08 17:13:51 UTC
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.
Comment 6 Chema Alonso Josa (RETIRED) gentoo-dev 2013-07-15 16:27:35 UTC
Thanks for reporting.

Upstream bug filed:

https://fedorahosted.org/logrotate/ticket/32
Comment 7 Alois Schmid 2013-07-18 08:39:19 UTC
Error also occurs if first log file is not rotated.
Comment 8 Chema Alonso Josa (RETIRED) gentoo-dev 2013-07-18 10:01:46 UTC
Upstream has released a fix [1]. Works for me, can you test it?

Thanks.

[1] https://fedorahosted.org/logrotate/changeset/433
Comment 9 Alois Schmid 2013-07-19 13:01:26 UTC
Works for me also. Anyone posting the results upstream?
Comment 10 Chema Alonso Josa (RETIRED) gentoo-dev 2013-07-19 13:38:43 UTC
Yes, upstream is updated.

Closing bug. Thanks.
Comment 11 effie mouzeli 2013-12-03 13:24:50 UTC
*** Bug 492806 has been marked as a duplicate of this bug. ***