<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>10409</bug_id>
          
          <creation_ts>2002-11-07 18:42 0000</creation_ts>
          <short_desc>root receives alot of mails from /usr/sbin/run-crons</short_desc>
          <delta_ts>2005-07-17 13:06:51 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Core system</component>
          <version>1.4_rc1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>j_r_fonseca@yahoo.co.uk</reporter>
          <assigned_to>bug-wranglers@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>j_r_fonseca@yahoo.co.uk</who>
            <bug_when>2002-11-07 18:42:30 0000</bug_when>
            <thetext>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: &lt;root@localhost.localdomain&gt;                                      
            
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 &lt;root@localhost&gt; test -x /usr/sbin/run-crons &amp;&amp;
/usr/sbin/run-crons           
X-Cron-Env: &lt;SHELL=/bin/sh&gt;                                                    
            
X-Cron-Env: &lt;HOME=/root&gt;                                                       
            
X-Cron-Env: &lt;PATH=/usr/bin:/bin&gt;                                               
            
X-Cron-Env: &lt;LOGNAME=root&gt;                                                     
            
Message-Id: &lt;20021107190001.6301227FA1@localhost.localdomain&gt;                  
            
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&apos;t find the cron.hourly file and
everything will proceed as normal.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>j_r_fonseca@yahoo.co.uk</who>
            <bug_when>2002-11-07 18:43:54 0000</bug_when>
            <thetext>Created an attachment (id=5464)
run-crons.diff
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2002-11-07 20:11:45 0000</bug_when>
            <thetext>

*** This bug has been marked as a duplicate of 8506 ***</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>5464</attachid>
            <date>2002-11-07 18:43 0000</date>
            <desc>run-crons.diff</desc>
            <filename>run-crons.diff</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHJ1bi1jcm9ucy5vbGQJMjAwMi0wOC0yOCAwOTo1NDowNS4wMDAwMDAwMDAgKzAxMDAKKysr
IHJ1bi1jcm9ucwkyMDAyLTExLTA4IDAwOjQzOjQwLjAwMDAwMDAwMCArMDAwMApAQCAtNDUsNyAr
NDUsNyBAQAogCQkjPj0gMzAgZGF5cywgNSBtaW4gLT0+ICs0MzIwNCBtaW4KIAkJVElNRT0iLWNt
aW4gKzQzMjA0IiA7OwogCWVzYWMKLQlmaW5kIC92YXIvc3Bvb2wvY3Jvbi9sYXN0cnVuL2Nyb24u
JEJBU0UgJFRJTUUgLWV4ZWMgcm0ge30gXDsKKwlmaW5kIC92YXIvc3Bvb2wvY3Jvbi9sYXN0cnVu
IC1uYW1lIGNyb24uJEJBU0UgJFRJTUUgLWV4ZWMgcm0ge30gXDsKICAgICBmaQogCiAgICAgIyBp
ZiB0aGVyZSBpcyBubyB0b3VjaCBmaWxlLCBtYWtlIG9uZSB0aGVuIHJ1biB0aGUgc2NyaXB0cyAK
</data>        

          </attachment>
    </bug>

</bugzilla>