From owner-freebsd-current@FreeBSD.ORG Wed Jun 2 09:11:50 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D001316A4CE; Wed, 2 Jun 2004 09:11:50 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7FBF843D54; Wed, 2 Jun 2004 09:11:50 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id i52GBnU7008866; Wed, 2 Jun 2004 11:11:49 -0500 (CDT) (envelope-from dan) Date: Wed, 2 Jun 2004 11:11:49 -0500 From: Dan Nelson To: Bruce Evans Message-ID: <20040602161148.GA3067@dan.emsphone.com> References: <20040602134523.GA26835@genius.tao.org.uk> <20040602140148.GA27036@genius.tao.org.uk> <20040602140923.GA27070@genius.tao.org.uk> <20040603011806.E25331@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040603011806.E25331@gamplex.bde.org> X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: Josef Karthauser cc: current@freebsd.org cc: Mark Murray Subject: Re: Problems with periodic scripts in jails [Cron /usr/libexec/save-entropy] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2004 16:11:51 -0000 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