Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Jun 2004 11:11:49 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Mark Murray <mark@grondar.org>
Subject:   Re: Problems with periodic scripts in jails [Cron <operator@sosai> /usr/libexec/save-entropy]
Message-ID:  <20040602161148.GA3067@dan.emsphone.com>
In-Reply-To: <20040603011806.E25331@gamplex.bde.org>
References:  <20040602134523.GA26835@genius.tao.org.uk> <20040602140148.GA27036@genius.tao.org.uk> <20040602140923.GA27070@genius.tao.org.uk> <20040603011806.E25331@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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@allantgroup.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040602161148.GA3067>