From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 25 16:37:22 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 5510A1065674 for ; Fri, 25 Nov 2011 16:37:22 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1278A8FC14 for ; Fri, 25 Nov 2011 16:37:21 +0000 (UTC) Received: by vcbfk1 with SMTP id fk1so2684029vcb.13 for ; Fri, 25 Nov 2011 08:37:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=bk2jkoDXM11RAtpIgLKMfafCAIkMUD/0KRnH3TSq1eE=; b=bq2jmCaFPn7fkFmxnwNTTt4K3oGMcc25avqEGf4ukmj7z5WFJr1U7DoLf5K0nBM3i6 3k1vYTmuqXN9ZZKSCkk5bQzlQJ/+CHA0vhJZ+gq7SJ/ymH545bFqebfkgjXih74ZIeQv iVkdl4a6hMQEELEdAk/Y3GQKdb2JYo2yEiKwU= MIME-Version: 1.0 Received: by 10.52.68.79 with SMTP id u15mr34363635vdt.5.1322239041334; Fri, 25 Nov 2011 08:37:21 -0800 (PST) Received: by 10.52.182.40 with HTTP; Fri, 25 Nov 2011 08:37:21 -0800 (PST) In-Reply-To: <201111251609.pAPG97dT008848@slippy.cwsent.com> References: <4ECF54F1.50203@FreeBSD.org> <201111251609.pAPG97dT008848@slippy.cwsent.com> Date: Fri, 25 Nov 2011 16:37:21 +0000 Message-ID: From: Tom Evans To: Cy Schubert Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: 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: Fri, 25 Nov 2011 16:37:22 -0000 On Fri, Nov 25, 2011 at 4:09 PM, Cy Schubert wro= te: > Changing the behaviour by default would change the semantics of @reboot, > altering =C2=A0the behaviour of cron jobs which rely on the brokenness. W= hat if > both behaviours are wanted on the same system? Unlikely, as I can't see > anyone relying on this broken behaviour. Having said that, I'm sure there > are cron jobs that do rely on the broken behaviour, so it may be best to > simply deprecate the broken behaviour and make one or the other a command > line option. The problem is that the behaviour is not broken, it works exactly as described in crontab(5) - it is just confusing. It's also slightly nonsensical - the command isn't run at reboot, it is run at boot. How about leaving @reboot exactly as it is, improving the docs so that it is clear what @reboot does, and add a @boot to vixie-cron which would only run at boot time. I think it isn't wise to change how one strange to use format behaves under FreeBSD when vixie-cron is a quite ubiquitous choice amongst nix variants. With regards to anything that runs at boot, I think dumbly checking that the boot time was less than N minutes ago is also sub-optimal. If cron keeps dieing and respawning close to boot time, your cronjob could trigger multiple times. I don't know the exact semantics of kern.boottime - at what point is the boot time stored? If it is before file systems are mounted, an unclean file system triggering a foreground fsck could delay boot time by hours, thereby forcing cron to not think that it is running at boot time when it is finally started. Cheers Tom Cheers Tom