Hi!

On all my servers I receive from time to time (usually once in 5-30 days)
email with subject subj :) and content:
---cut---
find: /var/spool/cron/lastrun/cron.hourly: No such file or directory
---cut---

I suppose this is because of race condition somethere in /usr/sbin/run-crons.
Root's default crontab is:
---cut---
*/15 * * * *     test -x /usr/sbin/run-crons && /usr/sbin/run-crons
0  *   * * *     rm -f /var/spool/cron/lastrun/cron.hourly
0  8   * * *     rm -f /var/spool/cron/lastrun/cron.daily
15 11  * * 6     rm -f /var/spool/cron/lastrun/cron.weekly
30 12  1 * *     rm -f /var/spool/cron/lastrun/cron.monthly
---cut---
and I think if first two lines from crontab will start at same time and
/usr/sbin/run-crons will check for existence of lastrun/cron.hourly
__BEFORE__ rm will remove it then race condition happens and result in
that email sent to root.

Can anybody confirm this?

If I'm right, then maybe better to change last 4 lines in crontab to not
run in %15 minute:
---cut---
*/15 * * * *     test -x /usr/sbin/run-crons && /usr/sbin/run-crons
5  *   * * *     rm -f /var/spool/cron/lastrun/cron.hourly
5  8   * * *     rm -f /var/spool/cron/lastrun/cron.daily
20 11  * * 6     rm -f /var/spool/cron/lastrun/cron.weekly
35 12  1 * *     rm -f /var/spool/cron/lastrun/cron.monthly
---cut---

-- 
                        WBR, Alex.
-- 
[email protected] mailing list

Reply via email to