From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 25 17:53:48 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 F02DD106566C for ; Fri, 25 Nov 2011 17:53:48 +0000 (UTC) (envelope-from dieterbsd@engineer.com) Received: from mailout-us.gmx.com (mailout-us.gmx.com [74.208.5.67]) by mx1.freebsd.org (Postfix) with SMTP id 9972E8FC16 for ; Fri, 25 Nov 2011 17:53:48 +0000 (UTC) Received: (qmail 8347 invoked by uid 0); 25 Nov 2011 17:53:47 -0000 Received: from 67.206.186.8 by rms-us003.v300.gmx.net with HTTP Content-Type: text/plain; charset="utf-8" Date: Fri, 25 Nov 2011 12:53:43 -0500 From: "Dieter BSD" Message-ID: <20111125175344.233450@gmx.com> MIME-Version: 1.0 To: hackers@freebsd.org X-Authenticated: #74169980 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 Content-Transfer-Encoding: 8bit X-GMX-UID: Z6OuKlg6zVK0IR3RHjUzbss/Njh6dI4W Cc: 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: Fri, 25 Nov 2011 17:53:49 -0000 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.