Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Nov 2011 21:33:09 +0100
From:      Jilles Tjoelker <jilles@stack.nl>
To:        APseudoUtopia <apseudoutopia@gmail.com>
Cc:        Christian Kastner <debian@kvr.at>, freebsd-hackers@freebsd.org
Subject:   Re: cron(8) mis-feature with @reboot long after system startup
Message-ID:  <20111126203309.GB89541@stack.nl>
In-Reply-To: <CAKOHg=Mc=6MS-YZPUreHmDYXfNoHVA_t-o1ZZfe3bMRUSRd0DA@mail.gmail.com>
References:  <20111125070241.GA7915@DataIX.net> <4ED00A68.4040606@kvr.at> <CAKOHg=Mc=6MS-YZPUreHmDYXfNoHVA_t-o1ZZfe3bMRUSRd0DA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Nov 26, 2011 at 02:58:46PM -0500, APseudoUtopia wrote:
> On Fri, Nov 25, 2011 at 4:36 PM, Christian Kastner <debian@kvr.at> 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



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