From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 26 20:33:11 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4403C1065670 for ; Sat, 26 Nov 2011 20:33:11 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id D4A7C8FC0A for ; Sat, 26 Nov 2011 20:33:10 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id C35381DD64F; Sat, 26 Nov 2011 21:33:09 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 9D07628468; Sat, 26 Nov 2011 21:33:09 +0100 (CET) Date: Sat, 26 Nov 2011 21:33:09 +0100 From: Jilles Tjoelker To: APseudoUtopia Message-ID: <20111126203309.GB89541@stack.nl> References: <20111125070241.GA7915@DataIX.net> <4ED00A68.4040606@kvr.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Christian Kastner , freebsd-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 List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2011 20:33:11 -0000 On Sat, Nov 26, 2011 at 02:58:46PM -0500, APseudoUtopia wrote: > On Fri, Nov 25, 2011 at 4:36 PM, Christian Kastner wrote: > > On 2011-11-25 08:02, Jason Hellenthal wrote: > >> So with that said... is there a way we could actually make this run > >> @reboot only ? > > Debian's cron[0] and Fedora's cronie[1] have solved this by touching a > > file on first startup and running @reboot only when this file does not > > yet exist. > I like this idea, however it has a major caveat: Assuming the shutdown > scripts remove said file (and the boot scripts create said file), what > happens in the event that the disk was umount'ed uncleanly? For > example, a power failure (I know, that's what UPSs are for, but lets > ignore that for a second). If the system is configured to > automatically boot after a power failure, the @reboot cron script wont > run (since the said file still exists...). The file can be stored in /var/run, which is cleared at boot. -- Jilles Tjoelker