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

From: Dan Nelson <dnelson_at_allantgroup.com>
Date: Wed, 2 Jun 2004 11:11:49 -0500
In the last episode (Jun 03), Bruce Evans said:
> On Wed, 2 Jun 2004, Josef Karthauser wrote:
> > Ok, I've found the cause of the problem.  Cron is spawning more
> > than one copy of the entropy script...
> 
> Cron has been filling my mailbox with complaints about this for
> years. (I only partially filled the mailbox of the author of the
> entropy script with complaints about it 3 or 4 times :-).  In my
> case, the multiple crons are caused by /usr being nfs-mounted and the
> server being down.  cron forks OK, but each copy blocks waiting for
> something in /usr.  When the server comes back up, a thundering herd
> of entropy scripts run and clobber each others' rotation of the
> entropy files. Cron normally runs the entropy script every 11
> minutes, so the herd grows quickly.  The herd (or perhaps other
> herds) also exhausts pipe kva on machines with small amounts of RAM
> (64M) while waiting.

A nice addition to cron might be a way to tell it that certain jobs
should be single-instance.  I know about half of my cron jobs look
like:

/usr/local/bin/lockfile -r 1 -l 3600 /tmp/runjob.LCK && ( runjob ; rm /tmp/runjob.LCK )

and it'd be handy if cron would do this internally (no physical
lockfiles needed).  The least intrusive way would be to add a magic
variable similar to MAILTO; NO_OVERLAP=1 or something.  Anyone up for a
Junior Userland Hacker project? :)

-- 
	Dan Nelson
	dnelson_at_allantgroup.com
Received on Wed Jun 02 2004 - 07:11:50 UTC

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