From owner-freebsd-rc@FreeBSD.ORG Tue Oct 15 20:09:37 2013 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E8C621A9; Tue, 15 Oct 2013 20:09:36 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ob0-x233.google.com (mail-ob0-x233.google.com [IPv6:2607:f8b0:4003:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9A2AD24B6; Tue, 15 Oct 2013 20:09:36 +0000 (UTC) Received: by mail-ob0-f179.google.com with SMTP id wp18so2094369obc.24 for ; Tue, 15 Oct 2013 13:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=DSBRA6QPZgOvduK2pIhoc2cRL3CgvCVsL/vWQ9+hPno=; b=FGPxCCtYNzsnTL1gRlLbo7dHvXETVyI6vUuGHQLm4ODqOY4wL7YJ79QQX/zBAOJ6l5 EY0YnhN6WRP8LO6s6OegFK5r15X6e656eyrilLdO0HECCBwFiRbgulAm4+0Zh+8bTGiP /EuymkASZP8mhGPRwUH0p2bHT+JL9jp39Y6jwdZoOYQb0eMWaEBozET3nrA5us/Fv58q YdHE6k42gp7++cAciatWXgRz0zccIPbwdVLA8FBrW8Ei0vgt7mNNTx/vQWttXa11YsWx WdE89mBNxoT0akbTva44sdzky0qFnpHTROYEkS/N0+4mMDgW59IfycIKngto97ti4SKN qhxA== MIME-Version: 1.0 X-Received: by 10.182.225.162 with SMTP id rl2mr97492obc.72.1381867775962; Tue, 15 Oct 2013 13:09:35 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.182.110.195 with HTTP; Tue, 15 Oct 2013 13:09:35 -0700 (PDT) In-Reply-To: <525B258F.3030403@freebsd.org> References: <525B258F.3030403@freebsd.org> Date: Tue, 15 Oct 2013 13:09:35 -0700 X-Google-Sender-Auth: XQAiI64w5SQZ7yGb66opGjNCl6A Message-ID: Subject: Re: RFC: support for "first boot" rc.d scripts From: Matthew Fleming To: Colin Percival Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: FreeBSD current , freebsd-rc@freebsd.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Oct 2013 20:09:37 -0000 On Sun, Oct 13, 2013 at 3:58 PM, Colin Percival wrote: > Hi all, > > I've attached a very simple patch which makes /etc/rc: > > 1. Skip any rc.d scripts with the "firstboot" keyword if /var/db/firstboot > does not exist, > > 2. If /var/db/firstboot and /var/db/firstboot-reboot exist after running > rc.d > scripts, reboot. > > 3. Delete /var/db/firstboot (and firstboot-reboot) after the first boot. > We use something like this at work. However, our version creates a file after the firstboot scripts have run, and doesn't run if the file exists. Is there a reason to prefer one choice over the other? Naively I'd expect it to be better to run when the file doesn't exist, creating when done; it solves the problem of making sure the magic file exists before first boot, for the other polarity. Thanks, matthew