From owner-freebsd-rc@FreeBSD.ORG Mon Dec 2 19:17:55 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 ESMTPS id 9934DD06; Mon, 2 Dec 2013 19:17:55 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E4F91DBD; Mon, 2 Dec 2013 19:17:55 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa05.fnfis.com (8.14.5/8.14.5) with ESMTP id rB2JHrib012862 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 2 Dec 2013 13:17:54 -0600 Received: from LTCFISWMSGMB21.FNFIS.com ([169.254.1.7]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.03.0158.001; Mon, 2 Dec 2013 13:17:52 -0600 From: "Teske, Devin" To: Colin Percival Subject: Re: RFC: support for re-sourcing /etc/rc.conf Thread-Topic: RFC: support for re-sourcing /etc/rc.conf Thread-Index: AQHO75MygMZmDpdBLUKyR2AQoGR8qA== Date: Mon, 2 Dec 2013 19:17:52 +0000 Message-ID: <9EF48D5E-2706-4628-BF7B-DBBD5D7E227F@fisglobal.com> References: <529BEDDB.8010003@freebsd.org> <20131202.214853.1540734630471865242.hrs@allbsd.org> <529CD535.5010903@freebsd.org> In-Reply-To: <529CD535.5010903@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.120] Content-Type: text/plain; charset="us-ascii" Content-ID: <7564332EDB431545A8D0066267737C81@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.72, 1.0.14, 0.0.0000 definitions=2013-12-02_03:2013-12-02,2013-12-02,1970-01-01 signatures=0 Cc: Devin Teske , FreeBSD RC X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Devin Teske 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: Mon, 02 Dec 2013 19:17:55 -0000 On Dec 2, 2013, at 10:45 AM, Colin Percival wrote: > On 12/02/13 04:48, Hiroki Sato wrote: >> Colin Percival wrote: >> cp> I'd like to commit the attached patch to /etc/rc. When SIGALRM is r= eceived, >> cp> it reloads /etc/rc.conf; this makes it possible for an rc.d script t= o perform >> cp> first-boot system configuration and have it reflected by other rc.d = scripts. >> cp> >> cp> In particular, this will allow me to provide EC2 user-data of >> cp> >>/etc/rc.conf >> cp> firstboot_pkgs_enable=3D"YES" >> cp> firstboot_pkgs_list=3D"apache22" >> cp> to an image with the sysutils/ec2-scripts and sysutils/firstboot-pkg= s ports >> cp> installed, and have a system running with apache22 installed moments= later. >>=20 >> I am not familiar with sysutils/firstboot-pkgs and its use case, but >> is it correct that packages are installed during /etc/rc and then >> rc.conf will be updated before rc.d scripts for the installed >> packages run from /etc/rc? Where and when SIGALRM is sent from? >=20 > No, the other way around -- a different script (part of ec2-scripts) upda= tes > /etc/rc.conf based on metadata provided at VM launch time. One use of th= is > would be to set firstboot_pkgs_* variables to control the behaviour of the > firstboot-pkgs port moments later in the boot process. >=20 sysrc(8) in 9.2+ base comes to mind. NB: Available as a port for older releases 4.8+ (sysutils/sysrc) > So: > 1. VM image is created with ec2-scripts and firstboot-pkgs installed. > 2. VM image is launched with user-data saying "I want apache22". "bsdconfig startup_rcvar" in 9.2+ base comes to mind. NB: Avaiable as a port for older releases 9.0+ (sysutils/bsdconfig) > 3. Early in the boot process, ec2-scripts reads that user-data, updates > /etc/rc.conf, and signals /etc/rc. > 4. /etc/rc re-sources /etc/rc.conf. Cool. How's the signaling in #3 done to get #4? Edit: Hiroki suggests using using /etc/rc.conf.d/{name} Edit: "sysrc -f /etc/rc.conf.d/{name} firstboot_pkgs_{blah}=3Detc" comes to= mind > 5. Later in the boot process, firstboot-pkgs (having the new /etc/rc.conf > settings loaded) installs the apache22 package. >=20 /usr/share/bsdconfig/packages/packages.subr in 9.2+ base comes to mind. Library for installing packages from a script (from any media device). In 11.0-CURRENT, you have realtime API documentation: bsdconfig includes packages/packages or more specifically... bsdconfig includes -dF package_add Will display full description of the API function, f_package_add(). In 9.2-R or 9-STABLE (after SVN r252995), it uses pkg-tools. In 10.0-BETA4 or 10-STABLE (after SVN r258420) or higher, it uses pkgng. FYI: I like the idea of firstboot_pkgs_* I also like Hiroki's idea of stashing it all into rc.conf.d --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you.