Cron removes crontab after editting
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.
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.
#6 Updated by Timo Teräs about 3 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?