| Summary: | sys-process/anacron: Double execution of cron scripts if regular cron is also installed | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Richard Li <admin> |
| Component: | [OLD] Core system | Assignee: | Cron Team <cron-bugs+disabled> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | mephinet, neil |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: | Patch to /etc/anacrontab | ||
|
Description
Richard Li
2008-08-19 07:10:32 UTC
Created attachment 163272 [details, diff]
Patch to /etc/anacrontab
+1 5 cron.daily /usr/sbin/run-crons || run-parts /etc/cron.daily +7 10 cron.weekly test -x /usr/sbin/run-crons || run-parts /etc/cron.weekly +30 15 cron.monthly test -x /usr/sbin/run-crons || run-parts /etc/cron.monthly the cron.daily should also be a test, i presume? like so: +1 5 cron.daily test -x /usr/sbin/run-crons || run-parts /etc/cron.daily looks good otherwise... well - this doesnt work. run-crons is provided by cronbase and anacron deps on cronbase (ie. run-crons will always be installed if you have anacron installed). we need to find a different solution... so how about: if run-crons detects, that anacron is installed, it doesnt run any scripts? *** Bug 79842 has been marked as a duplicate of this bug. *** the default anacrontab in cvs has been changed to not run anything by default. a warning about the possible double execution of cron.{daily,weekly,monthly} scripts has also been added.
thanks for the report.
What I'm still wandering is what the real "solution" is. From reading the cron guide: "Anacron usually relies on a cron daemon to run it each day." If I understand that correctly, then vixie-cron should only call anacron on a daily basis, but not the run-crons. Anycron again will execute the run-crons. If this is right, then the vixie-cron configuration would have to depend on whether or not anacron is installed... I agree. Currently anacron relies on an init script to call it at startup. This doesn't seem a good idea. If I have anacron take care of cron.daily tasks, and keep my system on for two days, then those tasks are actually run only in the first day. I guess we should make cron run anacron every hour or so if it's installed, and run run-crons only if anacron is absent. (The problem with this solution is cron.hourly, but in my opinion, cron.hourly could be dropped. For tasks which need running so frequently, an usual crontab line "0 * * * * blabla" would just be fine.) (In reply to comment #7) > What I'm still wandering is what the real "solution" is. From reading the cron > guide: > > "Anacron usually relies on a cron daemon to run it each day." > > If I understand that correctly, then vixie-cron should only call anacron on a > daily basis, but not the run-crons. Anycron again will execute the run-crons. > > If this is right, then the vixie-cron configuration would have to depend on > whether or not anacron is installed... > |