Bug 10409 - root receives alot of mails from /usr/sbin/run-crons
Bug#: 10409 Product:  Gentoo Linux Version: 1.4_rc1 Platform: x86
OS/Version: Linux Status: RESOLVED Severity: major Priority: P2
Resolution: DUPLICATE Assigned To: bug-wranglers@gentoo.org Reported By: j_r_fonseca@yahoo.co.uk
Component: Core system
URL: 
Summary: root receives alot of mails from /usr/sbin/run-crons
Keywords:  
Status Whiteboard: 
Opened: 2002-11-07 18:42 0000
Description:   Opened: 2002-11-07 18:42 0000
There seems to be some kind of race-condition in /usr/bin/run-crons which
causes
the script to miss /var/spool/cron/lastrun/cron.hourly right under its nose,
and
root receives frequently emails all like:

------------------------------------------------------------------------
From root@localhost.localdomain  Thu Nov  7 19:00:01 2002                      

Return-Path: <root@localhost.localdomain>                                      

Delivered-To: root@localhost.localdomain                                       

Received: by localhost.localdomain (Postfix, from userid 0)                    

        id 6301227FA1; Thu,  7 Nov 2002 19:00:01 +0000 (WET)                   

From: root@localhost.localdomain (Cron Daemon)                                 

To: root@localhost.localdomain                                                 

Subject: Cron <root@localhost> test -x /usr/sbin/run-crons &&
/usr/sbin/run-crons           
X-Cron-Env: <SHELL=/bin/sh>                                                    

X-Cron-Env: <HOME=/root>                                                       

X-Cron-Env: <PATH=/usr/bin:/bin>                                               

X-Cron-Env: <LOGNAME=root>                                                     

Message-Id: <20021107190001.6301227FA1@localhost.localdomain>                  

Date: Thu,  7 Nov 2002 19:00:01 +0000 (WET)                                    

Status: RO                                                                     

Content-Length: 69                                                             

Lines: 1                                                                       



find: /var/spool/cron/lastrun/cron.hourly: No such file or directory           

------------------------------------------------------------------------

The race condition is not really a big deal. The constant mails are.

A easy solution is to replace

    find /var/spool/cron/lastrun/cron.$BASE $TIME -exec rm {} \;

by

    find /var/spool/cron/lastrun/ -name cron.$BASE $TIME -exec rm {} \;

and find will no longer complaint if it can't find the cron.hourly file and
everything will proceed as normal.

------- Comment #1 From José Fonseca 2002-11-07 18:43:54 0000 -------
Created an attachment (id=5464) [details]
run-crons.diff

------- Comment #2 From SpanKY 2002-11-07 20:11:45 0000 -------

*** This bug has been marked as a duplicate of 8506 ***