From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 25 08:27:50 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D98781065672 for ; Fri, 25 Nov 2011 08:27:50 +0000 (UTC) (envelope-from Cy.Schubert@komquats.com) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by mx1.freebsd.org (Postfix) with ESMTP id 9D4928FC0C for ; Fri, 25 Nov 2011 08:27:50 +0000 (UTC) Received: from pd3ml3so-ssvc.prod.shaw.ca ([10.0.141.149]) by pd2mo1so-svcs.prod.shaw.ca with ESMTP; 25 Nov 2011 01:12:48 -0700 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=svA9syYi2VW8WjUw5Fmdp5V1toRmC2VQL6MasMQUDjw= c=1 sm=1 a=FNQ37yD0mI0A:10 a=QrugwKR0C_UA:10 a=wAGQQ9Az6v0A:10 a=BLceEmwcHowA:10 a=ICAaq7hcmGcA:10 a=kj9zAlcOel0A:10 a=2Er20JxOMs3KTlR2XTlUiQ==:17 a=M0VwM5ZyAAAA:8 a=BWvPGDcYAAAA:8 a=6I5d2MoRAAAA:8 a=OT2V39PqUMkCechenPIA:9 a=CjuIK1q_8ugA:10 a=Xclt7nbD0wcA:10 a=V7tsTZBp22UA:10 a=SV7veod9ZcQA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO spqr.komquats.com) ([24.68.73.211]) by pd3ml3so-dmz.prod.shaw.ca with ESMTP; 25 Nov 2011 01:12:48 -0700 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 4AC1B46B6E; Fri, 25 Nov 2011 00:12:48 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.14.5/8.14.5) with ESMTP id pAP8ClDw011348; Fri, 25 Nov 2011 00:12:47 -0800 (PST) (envelope-from Cy.Schubert@komquats.com) Message-Id: <201111250812.pAP8ClDw011348@slippy.cwsent.com> X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.3 From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.komquats.com/ To: Jason Hellenthal In-Reply-To: Message from Jason Hellenthal of "Fri, 25 Nov 2011 02:02:41 EST." <20111125070241.GA7915@DataIX.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 25 Nov 2011 00:12:47 -0800 Cc: hackers@FreeBSD.org Subject: Re: cron(8) mis-feature with @reboot long after system startup X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Cy Schubert List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2011 08:27:50 -0000 In message <20111125070241.GA7915@DataIX.net>, Jason Hellenthal writes: > List, > > When using @reboot with cron you expect your proccesses to always start when > the system boots up and only when the system boots. But long after the system > in question had been booted, my @reboot processes ran again! after a (/etc/r > c.d/cron restart). This is normally fine and dandy until one of your @reboot > jobs needs to contain a process that purges files "files that are already in > use by a running daemon since the system has not rebooted" and becomes hazard > ous. > > So with that said... is there a way we could actually make this run @reboot o > nly ? > > Compare the system boottime (kern.boottime) to the current time and if it is > greater than ?5 minutes? do not run on any @reboot's ? or add yet another ext > ension @boottime so it does not throw off current functionality ? > > Surely I could modify the scripts which do this but I find it unproductive an > d counter intuitive for the need to explain that @reboot means "When cron is > restarted" even though the name means something completely opposite. I don't see how cron could run reboot jobs again while running. It calls run_reboot_jobs only during startup. Could it be possible that cron died on your system and you restarted it? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org