From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 26 20:28:05 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 C6084106566C for ; Sat, 26 Nov 2011 20:28:05 +0000 (UTC) (envelope-from apseudoutopia@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 544B38FC13 for ; Sat, 26 Nov 2011 20:28:04 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so7732145bkb.13 for ; Sat, 26 Nov 2011 12:28:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=29L6ulJlbIP/8GuSB3EIG/c0qeKg90zy0THeYhBaFq8=; b=il+kftWO10C3wFTdhS5eXA9lbFhWtX2c91NBymCy4cpFNQUF+/R/49MHLLb3GKN510 woPvA6CBVSnf/8lFKnTmEqPcWdZO3/JZv2051miNFMhfDlMe9E3GXRPUbXBS1pLCZ4r2 r9UiO7FpvTvXLOmRmVaeBPtjMoGZdNq0YMCs8= MIME-Version: 1.0 Received: by 10.204.157.154 with SMTP id b26mr39512734bkx.52.1322337526860; Sat, 26 Nov 2011 11:58:46 -0800 (PST) Received: by 10.204.184.8 with HTTP; Sat, 26 Nov 2011 11:58:46 -0800 (PST) In-Reply-To: <4ED00A68.4040606@kvr.at> References: <20111125070241.GA7915@DataIX.net> <4ED00A68.4040606@kvr.at> Date: Sat, 26 Nov 2011 14:58:46 -0500 Message-ID: From: APseudoUtopia To: Christian Kastner Content-Type: text/plain; charset=UTF-8 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 20:28:05 -0000 On Fri, Nov 25, 2011 at 4:36 PM, 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. > I like this idea, however it has a major caveat: Assuming the shutdown scripts remove said file (and the boot scripts create said file), what happens in the event that the disk was umount'ed uncleanly? For example, a power failure (I know, that's what UPSs are for, but lets ignore that for a second). If the system is configured to automatically boot after a power failure, the @reboot cron script wont run (since the said file still exists...).