From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 19 02:16:29 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 082132DE for ; Sun, 19 Oct 2014 02:16:29 +0000 (UTC) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 966DD897 for ; Sun, 19 Oct 2014 02:16:28 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id em10so3794865wid.13 for ; Sat, 18 Oct 2014 19:16:26 -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=VSrU9HPpDgGnO5npPV9QezwiWE5Kn5xzs9WgWbJBA3Y=; b=W0DBSZoXNTnW7/SwapUjQ6x3NX7DS8a/417/X+Nb8ePyenTfEQGxRV7fnXPO5TIwRK 0CxS1N0Bz4deIr4+2GafTggy5jerQQtXxPloPr7S8Xok7vMrt/bIbizYeGbWGtYI7JQW t2HO4FamZ3Vsv7QIk8DR9WVRWnOWCKZWnVS2pzWZV4Q6/szF9znp2IvEEgz1vUVR6nXP 8O9upspakxrTri51PgKtTGyaKU3LoVGMX9LFsjSfmXt5TwkOVrmhncoZZjUzhYC/+klq IOIxgr9cGbL/czGmK7GTZG8Tw07PktsG+pqaYuMEMBX8BV9h9u2h+ARu7jk0MnCAQ4YI qLnQ== MIME-Version: 1.0 X-Received: by 10.180.11.200 with SMTP id s8mr4156873wib.20.1413684986794; Sat, 18 Oct 2014 19:16:26 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Sat, 18 Oct 2014 19:16:26 -0700 (PDT) In-Reply-To: <5443191E.5050208@mu.org> References: <54430B41.3010301@NTLWorld.com> <5443191E.5050208@mu.org> Date: Sat, 18 Oct 2014 19:16:26 -0700 X-Google-Sender-Auth: o_Y06TP0MC0Dxe5CW9rniyHhrwU Message-ID: Subject: Re: nosh version 1.9 From: Adrian Chadd To: Alfred Perlstein Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-hackers@freebsd.org" , Jonathan de Boyne Pollard X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2014 02:16:29 -0000 On 18 October 2014 18:51, Alfred Perlstein wrote: > Very cool. > > Wondering about the idea of /etc/rc.conf *not* being a shell script... this > is sort of bad imo as I can't see any other way to provide the settings > dynamically for the startup scripts at a glance. > > I'll give you an example... FreeNAS (and by extension the appliance we are > building at Norse) has /etc/rc.conf.local as a shell script that pulls data > from an sqlite database, this allows us to set various services on/off based > on the contents of that sqlite database file. > > This in turn allows us to leverage most of the existing /etc/rc.d and by > extension the /usr/local/etc/rc.d files provided by ports. > > I'm wondering how one could still do that if /etc/rc.conf and > /etc/rc.conf.local were no longer scripts? The same way /etc/rc.conf and /etc/rc.conf.local is pulled in - via the little snippet of stuff at the end of /etc/defaults/rc.conf , and this bit of config in that file: local_startup="/usr/local/etc/rc.d" # startup script dirs. script_name_sep=" " # Change if your startup scripts' names contain spaces rc_conf_files="/etc/rc.conf /etc/rc.conf.local" So, we just need some method of pulling in environment variables in whatever order we need from whatever place we need. (God, why do I know this stuff? Then I remembered - https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=17595 . God damnit.) The tricky bit is trying to make it so we don't call sqlite like a thousand times to pull out all of the environment variables for each invocation of an rc script. -adrian