Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 476202 - =app-admin/logrotate-3.8.4 - sharedscripts postrotate does not execute if first log is missing
Summary: =app-admin/logrotate-3.8.4 - sharedscripts postrotate does not execute if fir...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chema Alonso Josa (RETIRED)
URL: https://fedorahosted.org/logrotate/ti...
Whiteboard:
Keywords:
: 492806 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-07-08 17:09 UTC by Adam Randall
Modified: 2013-12-03 13:24 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
syslog-ng broken logrotate configuration file (logrotate.syslog-ng.broken.txt,734 bytes, text/plain)
2013-07-08 17:10 UTC, Adam Randall
Details
syslog-ng working logrotate configuration file (logrotate.syslog-ng.working.txt,717 bytes, text/plain)
2013-07-08 17:10 UTC, Adam Randall
Details
Output of logrotate with broken syslog-ng config file. (logrotate.broken.txt,13.96 KB, text/plain)
2013-07-08 17:11 UTC, Adam Randall
Details
Output of logrotate with working syslog-ng config file. (logrotate.working.txt,14.33 KB, text/plain)
2013-07-08 17:11 UTC, Adam Randall
Details

Note You need to log in before you can comment on or make changes to this bug.
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. ***