From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 19 02:59:38 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 96D1B62A; Sun, 19 Oct 2014 02:59:38 +0000 (UTC) Received: from mail-la0-x22d.google.com (mail-la0-x22d.google.com [IPv6:2a00:1450:4010:c03::22d]) (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 E41CEB74; Sun, 19 Oct 2014 02:59:37 +0000 (UTC) Received: by mail-la0-f45.google.com with SMTP id q1so2386335lam.32 for ; Sat, 18 Oct 2014 19:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xtpshZwoePCAENk0cKiol7IvmDboQQmMwqC8lSTGqm4=; b=G3YtB0dQ24i2xE740hAU92uNzFf+IpXyhcXcuZbO54CL4Z3V6anAmCQwi++esKrrpW LxWicVMzsRfim/UnJWbb2YYBk2tWKf7RoppTxdmjWm5AWEj5jhxJJHRgiEV3s4ZCIuEo HaWnUdhMQtND+03RK9dihEwjydWruYzY174poCkmtxXWMqCih0+KfJ9EQk7Fdk6yBJaO ex5BY/der0EstreajFOHOK9UhEOU+d+ROqTWyPLqzIlcJgeGAUs/WrwpwXWZeMmBnvir uaItfqW/TeN0Uvxefq978guHMchyRq3/d3qlGhapBzTIlF6x9KJY98aynJiwzFL4vd1l d7YA== MIME-Version: 1.0 X-Received: by 10.153.4.7 with SMTP id ca7mr18338247lad.31.1413687575758; Sat, 18 Oct 2014 19:59:35 -0700 (PDT) Received: by 10.152.22.195 with HTTP; Sat, 18 Oct 2014 19:59:35 -0700 (PDT) In-Reply-To: <34F30D28-DE9B-444F-885E-F438FEEA46EC@mu.org> References: <54430B41.3010301@NTLWorld.com> <5443191E.5050208@mu.org> <34F30D28-DE9B-444F-885E-F438FEEA46EC@mu.org> Date: Sun, 19 Oct 2014 13:59:35 +1100 Message-ID: Subject: Re: nosh version 1.9 From: Outback Dingo To: Alfred Perlstein Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "freebsd-hackers@freebsd.org" , Adrian Chadd , 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:59:38 -0000 On Sun, Oct 19, 2014 at 1:38 PM, Alfred Perlstein wrote: > Adding lazy variable extension to sh should be relatively easy. > > Sent from my iPhone > > > On Oct 18, 2014, at 7:16 PM, Adrian Chadd wrote: > > > >> 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 > IMHO I think we'd be better off with launchd... but this does show intelligence.... > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to " > freebsd-hackers-unsubscribe@freebsd.org" > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >