From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 26 19:31:30 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 1588E1065672 for ; Sat, 26 Nov 2011 19:31:30 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id D469B8FC13 for ; Sat, 26 Nov 2011 19:31:29 +0000 (UTC) Received: by iakl21 with SMTP id l21so9698735iak.13 for ; Sat, 26 Nov 2011 11:31:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=/mOJEm2nkjrj8fIlOytnTP9IP2F4PKoHufwCW2TVvWI=; b=bl5xQV3PgOkuOxNP/XMF1RQUfhFuArgUlvVpjBlz/GmG/E86IJ9TCDy18S83Bhugch PFwU1H3i+Uw4p23YIex1nD47hVLWqT+cqxW+VbKVfXOto6wHo44K+my+a91prYDHx/NG jQ8/eLtv/3n3jocEbgNsy/KiLJB9SSa1rg4HI= Received: by 10.231.82.131 with SMTP id b3mr1343526ibl.74.1322334331086; Sat, 26 Nov 2011 11:05:31 -0800 (PST) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.231.12.139 with HTTP; Sat, 26 Nov 2011 11:05:00 -0800 (PST) In-Reply-To: <20111126190030.GA58253@DataIX.net> References: <20111125070241.GA7915@DataIX.net> <4ED00A68.4040606@kvr.at> <20111126051121.GA4628@DataIX.net> <20111126190030.GA58253@DataIX.net> From: Chris Rees Date: Sat, 26 Nov 2011 19:05:00 +0000 X-Google-Sender-Auth: 5tg7F9vghnN7DI-WFCQDdn9G4sk Message-ID: To: Jason Hellenthal Content-Type: text/plain; charset=ISO-8859-1 Cc: Christian Kastner , Michael Ross , 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 19:31:30 -0000 On 26 November 2011 19:00, Jason Hellenthal wrote: > On Sat, Nov 26, 2011 at 06:43:38AM +0100, Michael Ross wrote: >> Am 26.11.2011, 06:11 Uhr, schrieb Jason Hellenthal : >> > On Fri, Nov 25, 2011 at 10:36:40PM +0100, Christian Kastner 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. >> >> >> >> 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. >> >> >> > >> > While this sounds like a perfectly sane way to handle the problem at >> > hand this also introduces a need to write some cleanup code to take care >> > of the file semantics. I think comparing daemon start times to the time >> > a system was booted or similiar would alleviate the need for all that. >> > Maybe a flag for @reboot "-s " seconds after boottime to allow >> > running @reboot jobs. And set the default to 3600 seconds. At least this >> > would allow adjustment for those startup processes that may take some >> > considerable time before multiuser mode is entered. >> > >> > Just some thought. >> > >> > I really don't think we need to go the route of using files to store >> > information when there is enough information available already via >> > syscall's. >> >> If system startup were to be unusually delayed (dhcp or nfs trouble eg), >> $time_period might have passed when cron starts, so there would have to be >> some notifying mechanism for @reboot jobs not being run, and operator >> action would be required. >> > > I agree but also disagree. 1 hour or 3600 seconds is plenty of time to wait for the "@reboot" extension scripts to fire. Yes, and if I restart cron 30 minutes after boot, I'm screwed. Chris