[CentOS] cron.hourly runs twice

Wed Mar 17 22:20:48 UTC 2010
Jason Pyeron <jpyeron at pdinc.us>


--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.

 

> -----Original Message-----
> From: centos-bounces at centos.org 
> [mailto:centos-bounces at centos.org] On Behalf Of Timothy Murphy
> Sent: Wednesday, March 17, 2010 18:05
> To: centos at centos.org
> Subject: Re: [CentOS] cron.hourly runs twice
> 
> Jason Pyeron wrote:
> 
> >> >>> For some reason I cannot fathom,
> >> >>> cron.hourly runs twice each hour
> >> >>> on one of my two CentOS-5.4 systems,
> > 
> > Add this to the cron.hourly
> > 
> > #!/bin/sh
> > pstree -up >> /tmp/foo.log
> 
> I tried this; the relevant lines on the first machine are:
> -----------------------------------------
>         |-crond(9167)-+-crond(9439)---run-parts(9441)-+-awk(9452)
>         |             |                               `-foo(9450)---
> pstree(9451)
>         |             `-crond(9440)---run-parts(9442)-+-awk(9455)
>         |                                             `-foo(9454)---
> pstree(9456)
>         |-cupsd(5301)---{cupsd}(17775)
> -----------------------------------------
> and on the other CentOS machine:
> -----------------------------------------
>         

Good, what I thought

> |-crond(2824)---crond(28255)---run-parts(28256)---foo(28257)---
> pstree(28258)
> -----------------------------------------
> 
> I've checked that /etc/rc.d/init.d/crond on the two machines 
> are the same.
> So too is /etc/sysconfig/crond .
> 
> I'm not clear why crond starts another copy of crond, even on 
> the second machine?
> 

Please send output of:

for i in  /etc/crontab  /var/spool/cron/*; do echo $i && cat $i; done

> 
> --
> Timothy Murphy
> e-mail: gayleard /at/ eircom.net
> tel: +353-86-2336090, +353-1-2842366
> s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
> 
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
> 



On a side note clock changes are not the issue:

Daylight Saving Time and other time changes

       Local time changes of less than three hours, such as those caused by the
start or end of Daylight Saving Time, are handled specially.   This  only
applies to jobs that run at a specific time and jobs that are run with a
granularity greater than one hour.  Jobs that run more frequently are scheduled
normally.

       If time has moved forward, those jobs that would have run in the interval
that has been skipped will be  run  immediately. Conversely, if time has moved
backward, care is taken to avoid running jobs twice.

       Time  changes  of  more  than  3 hours are considered to be corrections
to the clock or timezone, and the new time is used immediately.