logrotate never recovers if the statefile is corrupted
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
logrotate (Debian) |
Fix Released
|
Unknown
|
|||
logrotate (Ubuntu) |
Fix Released
|
Medium
|
Eric Desrochers | ||
Trusty |
Fix Released
|
Medium
|
Eric Desrochers | ||
Xenial |
Fix Released
|
Medium
|
Eric Desrochers | ||
Zesty |
Fix Released
|
Medium
|
Eric Desrochers | ||
Artful |
Fix Released
|
Medium
|
Eric Desrochers |
Bug Description
[Impact]
logrotate never recovers if the statefile is corrupted unless you remove it or fix the corruption by hand.
Impact scenarios :
- System could eventually run out of disk space on a separate partition if mounted in "/var" or specifically "/var/log" or even worst if "/var/log" is on the same partition as "/" it could create even more damage if by any chance the partition is running out of free space.
- System keep updating the same files over and over, creating large size logfiles.
- ...
[Test Case]
- Install logrotate
- Run "/etc/cron.
- Modify "/var/lib/
- Re-run "/etc/cron.
Unless you remove the statefile and start again or fix the corruption by hand.
* Additionally, I will run the /path_to_
[Regression Potential]
* Risk of potential regression is low, and IMHO couldn't be worst than the actual situation where logrotate simply doesn't recover from a corrupt statefile.
* The current patch does recover (after verification) and has been through some upstream CI validation, community feedbacks, et al.
* Additionally, I will run the /path_to_
[Other Info]
* Upstream commit:
https:/
* Upstream bug:
https:/
* Debian bug:
https:/
description: | updated |
description: | updated |
Changed in logrotate (Ubuntu Zesty): | |
assignee: | nobody → Eric Desrochers (slashd) |
Changed in logrotate (Ubuntu Xenial): | |
assignee: | nobody → Eric Desrochers (slashd) |
Changed in logrotate (Ubuntu Trusty): | |
assignee: | nobody → Eric Desrochers (slashd) |
description: | updated |
description: | updated |
description: | updated |
tags: | removed: patch |
Changed in logrotate (Ubuntu Zesty): | |
status: | Confirmed → In Progress |
Changed in logrotate (Ubuntu Trusty): | |
status: | Confirmed → In Progress |
Changed in logrotate (Ubuntu Xenial): | |
status: | Confirmed → In Progress |
Changed in logrotate (Ubuntu Artful): | |
status: | In Progress → Fix Committed |
description: | updated |
description: | updated |
description: | updated |
Changed in logrotate (Debian): | |
status: | Unknown → New |
tags: |
added: verification-done-trusty removed: verification-needed-trusty |
tags: |
added: verification-needed-zesty removed: verification-done-zesty |
tags: |
added: verification-done-zesty removed: verification-needed-zesty |
tags: |
added: sts-sru-done removed: sts-sru-needed |
Changed in logrotate (Debian): | |
status: | New → Fix Released |
Using the above reproducer ^ ....
I confirm that logrotate never recover if the statefile is corrupted unless you remove it or fix the corruption by hand.
The upstream fix introduce in 3.12.0-18 [1] is fixing the issue[2] (tested using Artful so far)
Since all supported|devel releases are lower than 3.12 [3], then all releases are affected.
[1] - https:/ /github. com/logrotate/ logrotate/ commit/ b9d82003002c983 70e4131a7e43c76 afcd23306a
# git describe --contains b9d8200
3.12.0~18
[2] - https:/ /github. com/logrotate/ logrotate/ issues/ 45
[3] - rmadison 16.04.1 | xenial-updates | source, amd64, arm64, armhf, i386, powerpc, ppc64el, s390x
logrotate | 3.8.7-1ubuntu1 | trusty | source, amd64, arm64, armhf, i386, powerpc, ppc64el
logrotate | 3.8.7-1ubuntu1 | vivid | source, amd64, arm64, armhf, i386, powerpc, ppc64el
logrotate | 3.8.7-1ubuntu1.1 | trusty-updates | source, amd64, arm64, armhf, i386, powerpc, ppc64el
logrotate | 3.8.7-2ubuntu2 | xenial | source, amd64, arm64, armhf, i386, powerpc, ppc64el, s390x
logrotate | 3.8.7-2ubuntu2.
logrotate | 3.8.7-2ubuntu3 | zesty | source, amd64, arm64, armhf, i386, ppc64el, s390x
logrotate | 3.8.7-2ubuntu3 | artful | source, amd64, arm64, armhf, i386, ppc64el, s390x
Regards,
Eric