cron(8) mis-feature with @reboot long after system startup

APseudoUtopia apseudoutopia at gmail.com
Sat Nov 26 20:28:05 UTC 2011


On Fri, Nov 25, 2011 at 4:36 PM, Christian Kastner <debian at kvr.at> wrote:
> Hi,
>
> 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...).


More information about the freebsd-hackers mailing list