From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 26 05:11:39 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6157B1065670 for ; Sat, 26 Nov 2011 05:11:39 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id D98DC8FC08 for ; Sat, 26 Nov 2011 05:11:38 +0000 (UTC) Received: by wwe5 with SMTP id 5so3160096wwe.31 for ; Fri, 25 Nov 2011 21:11:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=zmcNmTFVd2myF/ztmm1eXLDMqt1uIaBYmTalgmPAlmk=; b=ihTMigU6jrhLr/aUgAP+ZZBzrUMNX6uXjEpknX5JrBGVYhpLPfZfIuNJJ2PfqLM88W GxiTd0vrW5nicv9Ey6gu24fIf2+KB+6kr/iGm1LxjnMT829A8S5VSWiIJdVOj4b/yxtx L5sGpBMmeL8RSAivz/kGH2NG45I0VYwJCiSdk= Received: by 10.227.198.7 with SMTP id em7mr23416423wbb.13.1322284297780; Fri, 25 Nov 2011 21:11:37 -0800 (PST) Received: from DataIX.net (ppp-21.55.dialinfree.com. [209.172.21.55]) by mx.google.com with ESMTPS id z35sm3237110wbm.12.2011.11.25.21.11.33 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Nov 2011 21:11:36 -0800 (PST) Sender: Jason Hellenthal Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id pAQ5BQmu010411 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 26 Nov 2011 00:11:26 -0500 (EST) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id pAQ5BLIF010410; Sat, 26 Nov 2011 00:11:21 -0500 (EST) (envelope-from jhell@DataIX.net) Date: Sat, 26 Nov 2011 00:11:21 -0500 From: Jason Hellenthal To: Christian Kastner Message-ID: <20111126051121.GA4628@DataIX.net> References: <20111125070241.GA7915@DataIX.net> <4ED00A68.4040606@kvr.at> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline In-Reply-To: <4ED00A68.4040606@kvr.at> Cc: freebsd-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: Sat, 26 Nov 2011 05:11:39 -0000 --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 25, 2011 at 10:36:40PM +0100, Christian Kastner wrote: > Hi, >=20 > On 2011-11-25 08:02, Jason Hellenthal wrote: > > So with that said... is there a way we could actually make this run @re= boot only ? >=20 > 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. >=20 > Note that while [0] may point to other patches that might be of interest > to FreeBSD, they are still WIP (as evident from the linked patch) as we > are still in the process of quiltifying our current code base. >=20 While this sounds like a perfectly sane way to handle the problem at hand t= his also introduces a need to write some cleanup code to take care of the f= ile semantics. I think comparing daemon start times to the time a system wa= s booted or similiar would alleviate the need for all that. Maybe a flag fo= r @reboot "-s " seconds after boottime to allow running @reboot jo= bs. And set the default to 3600 seconds. At least this would allow adjustme= nt for those startup processes that may take some considerable time before = multiuser mode is entered.=20 Just some thought. I really don't think we need to go the route of using files to store inform= ation when there is enough information available already via syscall's. >=20 > [0] > http://anonscm.debian.org/gitweb/?p=3Dpkg-cron/pkg-cron.git;a=3Dblob;f=3D= debian/patches/features/run-on-reboot;h=3D94bab7dcbc4b34e4686385ca3ba303745= 3f1f4bb;hb=3Drefs/heads/sf3 >=20 > [1] > http://git.fedorahosted.org/git/?p=3Dcronie.git;a=3Dcommitdiff;h=3D2abb46= f60f496e2725333a86ade0f3913981761d >=20 --LQksG6bCIzRHxTLp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJO0HT4AAoJEJBXh4mJ2FR+mooH/iN1y855ce0wwIL3UnJOOYHz U/N7gkPdFbuMJG2BARdApZpwuZ4HNNGnwE0S/aprJKzheHPM5/9vhLUDV8jzGxf9 RcCHvPes4viheH2XV3/ahrhqCodpSFKN7Gb/YwGM0fIcgvUf2Atv/P20Ur+/x2GE ZtdR+IO9a0GgjorKBclvD8j3JnXsZ7mY45dJ/xI5zYDH7k7OMGJhovCkfTOjWkhX zLYxwc4GKKBFkSNGTpzObENdYCHqKh1Bk/Vu7azrzmBX3qizPrKLVOg2eGt0ddm+ dMX+4t1iepd041zS5Q5k+y2uMDJrGfyiKDlYY6s+bOcLyLyNxGntWRiz2b5uYxc= =v2fY -----END PGP SIGNATURE----- --LQksG6bCIzRHxTLp--