Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Oct 2013 14:12:18 -0700
From:      Colin Percival <cperciva@freebsd.org>
To:        Matthew Fleming <mdf@FreeBSD.org>
Cc:        FreeBSD current <freebsd-current@freebsd.org>, freebsd-rc@freebsd.org
Subject:   Re: RFC: support for "first boot" rc.d scripts
Message-ID:  <525DAFB2.7090105@freebsd.org>
In-Reply-To: <CAMBSHm-YqxeVsjVXszh-4gt-doXZQVL%2BXKpx_65az8TrE_V0ow@mail.gmail.com>
References:  <525B258F.3030403@freebsd.org> <CAMBSHm-YqxeVsjVXszh-4gt-doXZQVL%2BXKpx_65az8TrE_V0ow@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/15/13 13:09, Matthew Fleming wrote:
> 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.

I don't see that making sure that the magic file exists is a problem, since
you'd also need to make sure you have knobs turned on in /etc/rc.conf and/or
extra rc.d scripts installed.

In a very marginal sense, deleting a file is safer than creating one, since if
the filesystem is full you can delete but not create.  It also seems to me that
the sensible polarity is that having something extra lying around makes extra
things happen rather than inhibiting them.

But probably the best argument has to do with upgrading systems -- if you update
a 9.2-RELEASE system to 10.1-RELEASE and there's a "first boot" script in that
new release, you don't want to have it accidentally get run simply because you
failed to create a /firstboot file during the upgrade process.

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?525DAFB2.7090105>