Bug #436
Cron removes crontab after editting
| Status: | Closed | Start date: | 09/27/2010 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 100% | |
| Category: | - | |||
| Target version: | - | |||
| Affected versions: |
Description
After editting /etc/crontab/root with crontab -e, the crontab for root is deleted. This appears to take place when any of the default periodic jobs are executed. It does not appear to happen if the crontab never editted.
Test: I added a line to the root crontab to execute a script every 10 minutes. The script simply writes a line to stdout.
The line I added to crontab looks like this: */10 * * * * /root/crontest
I used the crontab -e command to edit the crontab. After writing away the change, a file called 'cron.update' appears in /etc/crontabs/, containing a single line: root
Cron executes my job without issues until the first of the default periodic jobs is executed. At this point it removes both the 'update.cron' file and the root crontab completely. A backup of the crontab is kept in /var/spool/cron/cron.root.***
The above example is not completely reliable for the reason that the removal of the crontab does not necessarily occur on the execution of the first subsequent periodic job, but definitely at some point thereafter.
As I mentioned, if the crontab is never editted, this doesnt happen.
Associated revisions
main/busybox: fix disappearing crontabs bug
It's uninitialized memory use bug. The relevant parts are rewritten
in busybox-1.18.x and later, so this patch applies only to the
busybox-1.17.x versions. Fixes #436.
main/busybox: fix disappearing crontabs bug
It's uninitialized memory use bug. The relevant parts are rewritten
in busybox-1.18.x and later, so this patch applies only to the
busybox-1.17.x versions. Fixes #436.
(cherry picked from commit 8ee0078586a14008b9915450dbc719051ed7d3d0)
History
#1
Updated by Natanael Copa over 2 years ago
- Project changed from Alpine build tools to Alpine Linux
#2
Updated by Leonardo Arena over 2 years ago
Same problem here
#3
Updated by Matt Smith over 2 years ago
Reported upstream:
https://bugs.busybox.net/show_bug.cgi?id=2779
#4
Updated by Matt Smith over 2 years ago
Temporary work-around seems to be to edit the user's crontab directly, e.g.:
nano /etc/crontabs/root
#5
Updated by Jeff Bilyk over 2 years ago
We just experienced the same issue when running on Alpine 2.1.3. busybox-1.17.3-r3
#6
Updated by Timo Teräs over 2 years ago
This appears to be busybox-1.17.x bug. It looks like the relevant parts of the code are rewritten in busybox-1.18.x and later. I was able to reproduce this on bb-1.17.4, but not in busybox.git.
Ncopa, do we have plans to upgrade busybox to 1.18.x on alpine-2.1.x? Or should I patch bb-1.17 to fix this issue?
#7
Updated by Timo Teräs over 2 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset 8ee0078586a14008b9915450dbc719051ed7d3d0.
#8
Updated by Timo Teräs over 2 years ago
Applied in changeset 1677b3850f361b22a7abde8cbd245d240cf885fb.
#9
Updated by Natanael Copa about 2 years ago
- Status changed from Resolved to Closed