Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Oct 2014 18:51:26 -0700
From:      Alfred Perlstein <bright@mu.org>
To:        freebsd-hackers@freebsd.org,  Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com>
Subject:   Re: nosh version 1.9
Message-ID:  <5443191E.5050208@mu.org>
In-Reply-To: <54430B41.3010301@NTLWorld.com>
References:  <54430B41.3010301@NTLWorld.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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?



-Alfred

On 10/18/14, 5:52 PM, Jonathan de Boyne Pollard wrote:
> nosh version 1.9 is out.  If you've not heard of it, here's the blurb:
>
> * 
> http://homepage.ntlworld.com./jonathan.deboynepollard/Softwares/nosh.html
>
> If you also read the worked example, make sure that you read all of 
> the way to the bottom.  (-:  If you want to read more, there's a whole 
> Guide in the package, and lots of manual pages.
>
> There's now a command for converting FreeBSD /etc/rc.conf{,.local} 
> preset information (the *_enable variables) to service bundle preset 
> information.  For kicks, I've also added a small shim for the OpenBSD 
> "rcctl" command that they're busy inventing.  It's worth noting that 
> OpenBSD 5.6 now specifies that /etc/rc.conf{,.local} doesn't have 
> shell expansions and isn't necessarily sourced by a shell, which is 
> change that I welcome with open arms.  I will be looking at conversion 
> of OpenBSD *_flags variables; but the big thing that remains in this 
> area is a utility that pushes all of the other variables, apart from 
> *_enable, into envdirs in the appropriate service bundles, which is 
> going to be a tedious one-by-one slog because sometimes the variable 
> names don't match the service names, as you no doubt know.
>
> I set myself a task of converting to service bundles all but two of 
> the 157 non-target scripts that I found in a stock FreeBSD /etc/rc.d/ 
> .  I've reached 85.  A lot of the remaining scripts are complex, often 
> one-shot, shell scripts onto the side of which the rc.d start/stop 
> system has been bolted, with varying degrees of success.  If you are 
> interested in helping, one of the things that would help greatly is 
> factoring out the meat of some of these into helper commands of some 
> kind, reducing the lopsided hulks to something more like (say) 
> /etc/rc.d/rpcbind .  (I can supply a list.)  As reciprocal payment in 
> advance, I'm letting you know that /etc/rc.d/msgs is missing all of 
> the rc.d mechanism, and so does the same thing on every 
> start/stop/restart/whatever command verb. Although I suggest that 
> factoring out things in this way is a gain for the rc.d system, too, 
> and of mutual benefit.
> _______________________________________________
> 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?5443191E.5050208>