From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 19 02:38:20 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CECA04CB; Sun, 19 Oct 2014 02:38:20 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id BB0B2A01; Sun, 19 Oct 2014 02:38:20 +0000 (UTC) Received: from [100.77.89.211] (254.sub-70-211-79.myvzw.com [70.211.79.254]) by elvis.mu.org (Postfix) with ESMTPSA id 88441341F83D; Sat, 18 Oct 2014 19:38:20 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: nosh version 1.9 From: Alfred Perlstein X-Mailer: iPhone Mail (12A405) In-Reply-To: Date: Sat, 18 Oct 2014 19:38:19 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <34F30D28-DE9B-444F-885E-F438FEEA46EC@mu.org> References: <54430B41.3010301@NTLWorld.com> <5443191E.5050208@mu.org> To: Adrian Chadd 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:38:20 -0000 Adding lazy variable extension to sh should be relatively easy.=20 Sent from my iPhone > On Oct 18, 2014, at 7:16 PM, Adrian Chadd wrote: >=20 >> On 18 October 2014 18:51, Alfred Perlstein wrote: >> Very cool. >>=20 >> Wondering about the idea of /etc/rc.conf *not* being a shell script... th= is >> 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. >>=20 >> I'll give you an example... FreeNAS (and by extension the appliance we ar= e >> building at Norse) has /etc/rc.conf.local as a shell script that pulls da= ta >> from an sqlite database, this allows us to set various services on/off ba= sed >> on the contents of that sqlite database file. >>=20 >> 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. >>=20 >> I'm wondering how one could still do that if /etc/rc.conf and >> /etc/rc.conf.local were no longer scripts? >=20 > 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: >=20 > local_startup=3D"/usr/local/etc/rc.d" # startup script dirs. > script_name_sep=3D" " # Change if your startup scripts' names contain s= paces > rc_conf_files=3D"/etc/rc.conf /etc/rc.conf.local" >=20 > So, we just need some method of pulling in environment variables in > whatever order we need from whatever place we need. >=20 > (God, why do I know this stuff? Then I remembered - > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D17595 . God damnit.) >=20 > 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. >=20 >=20 > -adrian > _______________________________________________ > 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"= >=20