From owner-freebsd-current@FreeBSD.ORG Mon Oct 14 07:59:54 2013 Return-Path: Delivered-To: freebsd-current@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 975BB206; Mon, 14 Oct 2013 07:59:54 +0000 (UTC) (envelope-from nick@van-laarhoven.org) Received: from vps.van-laarhoven.org (www.hibma.org [IPv6:2a02:2308::216:3eff:feec:b1b5]) by mx1.freebsd.org (Postfix) with ESMTP id 4C55D217A; Mon, 14 Oct 2013 07:59:54 +0000 (UTC) Received: from [IPv6:2001:980:530a:1:44c2:cf25:e90c:4287] (unknown [IPv6:2001:980:530a:1:44c2:cf25:e90c:4287]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by vps.van-laarhoven.org (Postfix) with ESMTPSA id 6132F5F2286; Mon, 14 Oct 2013 09:55:54 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: RFC: support for "first boot" rc.d scripts From: Nick Hibma In-Reply-To: <525B258F.3030403@freebsd.org> Date: Mon, 14 Oct 2013 09:59:51 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <41F1219E-4DCC-4B04-A1DC-40038809556B@van-laarhoven.org> References: <525B258F.3030403@freebsd.org> To: Colin Percival X-Mailer: Apple Mail (2.1510) Cc: FreeBSD current , freebsd-rc@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Oct 2013 07:59:54 -0000 Colin, Sounds useful: We have nanobsd images that configure a hard disk if = present, but obviously only need to be run once. However: NanoBSD stores uses a memory disk for /etc and stores it's = permanent scripts in /conf/* (/etc/rc.initdiskless) and/or /cfg = (NanoBSD) so I doubt whether the 'embedded systems' argument is of much = use, as deleting the script or flagging 'firstboot' is non-permanent. Nick Hibma nick@van-laarhoven.org Want to feel like going on a holiday tomorrow? Try GTD. On 14 Oct 2013, at 00:58, Colin Percival wrote: > Hi all, >=20 > I've attached a very simple patch which makes /etc/rc: >=20 > 1. Skip any rc.d scripts with the "firstboot" keyword if = /var/db/firstboot > does not exist, >=20 > 2. If /var/db/firstboot and /var/db/firstboot-reboot exist after = running rc.d > scripts, reboot. >=20 > 3. Delete /var/db/firstboot (and firstboot-reboot) after the first = boot. >=20 > The purpose of this is to support "run on first boot" rc.d scripts. = These can > be useful for both virtual machines and embedded systems; unlike = conventional > desktops and servers, these may have a lengthy gap between = "installing" and > "turning on" the system. >=20 > As examples of what such scripts could do: >=20 > * In Amazon EC2, I use a "first boot" script to download an SSH public = key > from EC2 so that users can log in to newly provisioned EC2 instances. >=20 > * Now that (starting from 10.0-BETA1) it is possible to use FreeBSD = Update > to update everything on EC2 instances, I'm planning on writing a = script which > runs 'freebsd-update fetch install' when the system first boots, and = then > reboots if there were updates installed. (I imagine this would be = useful > to other embedded / VM providers too.) >=20 > * Once packages are provided (properly) for 10.0 I'd like to allow = people to > specify a list of packages they want installed onto an EC2 instance = and have > them downloaded and installed when the EC2 instance launches. >=20 > I'd like to get this into HEAD in the near future in the hope that I = can > convince re@ that this is a simple enough (and safe enough) change to = merge > before 10.0-RELEASE. >=20 > Comments? >=20 > --=20 > Colin Percival > Security Officer Emeritus, FreeBSD | The power to serve > Founder, Tarsnap | www.tarsnap.com | Online backups for the truly = paranoid > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to = "freebsd-current-unsubscribe@freebsd.org"