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
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1385464

Title:
  logrotate fails to run, if status file is corrupt (logrotate running
  during reboot?)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/logrotate/+bug/1385464/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to