Date: Sun, 19 Oct 2014 13:59:35 +1100 From: Outback Dingo <outbackdingo@gmail.com> To: Alfred Perlstein <bright@mu.org> Cc: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>, Adrian Chadd <adrian@freebsd.org>, Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@ntlworld.com> Subject: Re: nosh version 1.9 Message-ID: <CAKYr3zwFyOh0VuQew5XtzKCNe0sDe2qc_5Jg3g9hT8pE7SyhJA@mail.gmail.com> In-Reply-To: <34F30D28-DE9B-444F-885E-F438FEEA46EC@mu.org> References: <54430B41.3010301@NTLWorld.com> <5443191E.5050208@mu.org> <CAJ-VmomhxAkmVpAv5M%2Bh2HiEGnzHuXoZRh=E3LEvcRqbkoJ-5Q@mail.gmail.com> <34F30D28-DE9B-444F-885E-F438FEEA46EC@mu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Oct 19, 2014 at 1:38 PM, Alfred Perlstein <bright@mu.org> 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 <adrian@freebsd.org> wrote: > > > >> On 18 October 2014 18:51, Alfred Perlstein <bright@mu.org> 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" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKYr3zwFyOh0VuQew5XtzKCNe0sDe2qc_5Jg3g9hT8pE7SyhJA>