logrotate does not check the syntax of the template in the configuration file.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
logrotate (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
# lsb_release -rd
Description: Ubuntu 10.04.4 LTS
Release: 10.04
# dpkg -l logrotate | grep ^ii
ii logrotate 3.7.8-4ubuntu2.2
# apt-cache policy logrotate
logrotate:
Installed: 3.7.8-4ubuntu2.2
Candidate: 3.7.8-4ubuntu2.2
Version table:
*** 3.7.8-4ubuntu2.2 0
500 http://<apt-server>/ lucid-updates/main Packages
500 http://<apt-server>
100 /var/lib/
3.7.8-4ubuntu2 0
500 http://<apt-server>
When logrotate runs, it doesn't check the syntax of the template in the configuration file.
For example, in the configuration file /etc/logrotate.
/var/log/xferlog
create 600 root root
missingok
notifempty
rotate 4
weekly
compress
}
There's a missing bracket at the begining of the template. logrotate will treat the above lines as files:
/var/log/xferlog
create
600
root
What happens is that, when the weekly cron runs, it will move the directory /root into /root.1 and create a flat file /root in its place. This causes a major problem in a cluster environment.
The problem is reproducible.
The content of the status file /var/lib/
logrotate state -- version 2
...
"/var/log/uucp.log" 2011-10-15
"600" 2012-11-2
"/var/log/btmp" 2012-11-1
...
"create" 2012-11-2
"/var/log/
"/var/log/xferlog" 2012-11-4
...
"root" 2012-11-4
...