Re: Problems with periodic scripts in jails [Cron <operator_at_sosai> /usr/libexec/save-entropy]

From: Josef Karthauser <joe_at_FreeBSD.org>
Date: Wed, 2 Jun 2004 15:09:23 +0100
On Wed, Jun 02, 2004 at 03:01:48PM +0100, Josef Karthauser wrote:
> > > (y/n [n]) not overwritten
> > 
> > Not the answer you are looking for, but the entropy cronjob is an example
> > of the type of cronjob that IMVHO should not be run in jails.
> > 
> 
> Probably not :)  The point is though that there is no reason why we
> should be getting permission errors here, save some kind of race
> condition.
> 

Ok, I've found the cause of the problem.  Cron is spawning
more than one copy of the entropy script...

I've got the same problem with the election script I run on the server:

    obleo# crontab -u root -l
    # Run the election process
    */2 * * * * ~joe/elections/cronjobs/doit

    obleo# grep doit /var/log/cron | tail
    Jun  2 14:00:00 obleo /usr/sbin/cron[90837]: (root) CMD (~joe/elections/cronjobs/doit)
    Jun  2 14:00:01 obleo /usr/sbin/cron[90904]: (root) CMD (~joe/elections/cronjobs/doit)
    Jun  2 14:02:00 obleo /usr/sbin/cron[91017]: (root) CMD (~joe/elections/cronjobs/doit)
    Jun  2 14:02:00 obleo /usr/sbin/cron[91048]: (root) CMD (~joe/elections/cronjobs/doit)
    Jun  2 14:04:00 obleo /usr/sbin/cron[91162]: (root) CMD (~joe/elections/cronjobs/doit)
    Jun  2 14:04:00 obleo /usr/sbin/cron[91166]: (root) CMD (~joe/elections/cronjobs/doit)
    Jun  2 14:06:00 obleo /usr/sbin/cron[91297]: (root) CMD (~joe/elections/cronjobs/doit)
    Jun  2 14:06:00 obleo /usr/sbin/cron[91301]: (root) CMD (~joe/elections/cronjobs/doit)
    Jun  2 14:08:00 obleo /usr/sbin/cron[91402]: (root) CMD (~joe/elections/cronjobs/doit)
    Jun  2 14:08:00 obleo /usr/sbin/cron[91448]: (root) CMD (~joe/elections/cronjobs/doit)

    obleo# ps  -auxww | grep cron
    root     23586  0.0  0.0  1396  948  ??  IsJ  Mon01PM   0:00.83 /usr/sbin/cron

There's only one running!!!

Joe
-- 
Josef Karthauser (joe_at_tao.org.uk)	       http://www.josef-k.net/
FreeBSD (cvs meister, admin and hacker)     http://www.uk.FreeBSD.org/
Physics Particle Theory (student)   http://www.pact.cpes.sussex.ac.uk/
================ An eclectic mix of fact and theory. =================

Received on Wed Jun 02 2004 - 05:09:24 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:55 UTC