touch-packages team mailing list archive
-
touch-packages team
-
Mailing list archive
-
Message #29125
[Bug 1385464] Re: logrotate fails to run, if status file is corrupt (logrotate running during reboot?)
To be clear, this issue was observed on Touch.
Interestingly, we already have a fix for this, but it hasn't landed in
the archive or on Tocuh; the upstart session init has a logrotate job
(/usr/share/upstart/sessions/logrotate.conf) which is used to rotate the
users session init log files. I'd noticed the corruption issue and put a
fix in the tip of lp:ubuntu/upstart. Essentially, the solution is to
remove the status file as it will be regenerated on next logrotate run.
However, if the status file is corrupt, logrotate will never rewrite it
and as such, no logrotation occurs leading to unlimited logfile growth.
Here's the fix from the upstart job:
__________
# Sometimes the state file can become corrupt (probably caused by
# logrotate updating it on shutdown). In these cases the file ends in
# nul bytes which causes a subsequent logrotate run (even a forced run)
# to refuse to process it meaning no files get rotated.
#
# Hence, if nul bytes are detected, reset the state file to allow logrotate
# to work.
[ -e "$statefile" ] && egrep '[^[:print:]]' "$statefile" && rm "$statefile"
__________
--
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to logrotate in Ubuntu.
https://bugs.launchpad.net/bugs/1385464
Title:
logrotate fails to run, if status file is corrupt (logrotate running
during reboot?)
Status in “logrotate” package in Ubuntu:
New
Bug description:
phablet@ubuntu-phablet:~$ du -h /var/log/syslog
654M /var/log/syslog
phablet@ubuntu-phablet:~$ sudo logrotate -f /etc/logrotate.conf
error: bad top line in state file /var/lib/logrotate/status
phablet@ubuntu-phablet:~$ cat /var/lib/logrotate/status
/opt/click.ubuntu.com/com.ubuntu.developer.webapps.webapp-gmail/1.0.25phablet@ubuntu-phablet:~$
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/logrotate/+bug/1385464/+subscriptions
References