logrotate cron script fails for logs with a space
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
logrotate (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
/etc/cron.daily has a script called "logrotate" which will kick off logrotate. Before logrotate is executed, the script scans the logrotate status file, located in /var/lib/
This script is written in a way which assumes all log files will not have spaces in their name, causing logrotate not to be passed these log files for rotation. The sequence of events is:
1) logrotate bash script starts, starting logrote, which looks into /etc/logrotate.d for logrotate configuration files. It inserts the relevant log file names into /var/lib/
2) Once one hour has passed, cron calls the logrotate bash script again. It scans /var/lib/
3) logrotate starts, and as it does not have an entry for the log, adds it back into the status file, but does not rotate (same as 1) )
Attached is a patch - a replacement logrotate cron script.
---------
Ubuntu Server 11.04 Natty x64
logrotate 3.7.8-6ubuntu3.1
cron 3.0pl1-116ubuntu1
description: | updated |
description: | updated |
description: | updated |
Removed verbopse flag from previous patch