Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Nov 2011 12:53:43 -0500
From:      "Dieter BSD" <dieterbsd@engineer.com>
To:        hackers@freebsd.org
Subject:   Re: cron(8) mis-feature with @reboot long after system startup
Message-ID:  <20111125175344.233450@gmx.com>

next in thread | raw e-mail | index | archive | help
The system doesn't go multiuser until the rc jobs complete,
even if you attempt to background them with '&'.  This can be
a problem with long running jobs.  I started using cron @reboot
for this reason.

I haven't run into the problem since I've never needed to run
/etc/rc.d/cron restart.

> Add an option to cron to check lastlog and if within 5 or 10 minutes
> of the last reboot, then call run_reboot_jobs().

Depending on timestamps might be okay as a temporary quick-and-dirty
workaround, but there is likely to be a case where it will also do the
wrong thing.  What if you need to restart cron within the 5-10 minutes?

Maybe something like: rc script sets a flag, cron_reboot script checks
and resets flag.  The flag could be a file ("> /tmp/rebooting_system").
Better yet, a run-the-reboot-script command line option could be added
to cron.



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