Subject: Re: The new rc.d stuff...
To: David Brownlee <abs@netbsd.org>
From: Scott Aaron Bamford <sab@ansic.net>
List: current-users
Date: 04/01/2000 10:43:11
I've started on such a program. Currently it only checks (though i wanted it
to add (for pkgsrc) del enable and disable, and also suport a combination of
the conflicting points you mentioned.

If someone can give me an address i can mail it to and they put it on an ftp
for anyone thats intrested to tell me if its going in the right direction at
all? (sorrie i dont have access to any ftp servers)

btw. it has no helpfile so...

sab@blip:c/rcconf/rcconf% ./rcconf
usage: rcconf [-aAnv] [check] file [...]


rcconf check /etc/rc.d/* 
should list all enabled files

rcconf -n check /etc/rc.d/*
should list all disabled files

the check is optional (will default to check) but ill add the other keywords
(enable,disable,add,del) soon.

on a slightly longer term, im also working on making it convert to a monolithic
script using a rc.subr replacement file (so the checks for require_files use
if [ -f ] etc.) i have no idea how well it will work but is something id like
to try anyway.

any files which dont use run_rc_{command,script} give an error to stderr.

rcconf -a /etc/rc.d/somefile 
lists all varibles visable from the file (includes parased)

rcconf -av /etc/rc.d/somefile
does the same but with values.

using -A instead of -a shows all functions to.

its basicly split into two parts:
librcconf/rcconf_cap.h
simple libaray to get the file into (TODO: and out of) the linked list format
search etc. caches open lists (with a count) and has special cases for
/etc/rc.conf /etc/rc.subr and /etc/rc.local.conf to save on time reparsing these
files which will be included from most files we parse. see notes bellow.

and 

rcconf - program
frount end. ive tried to keep all /etc/rc.subr stuff in subr.[ch] but might not
be perfect yet. It shouldn't take long to add the enable and disable functions
now i have the core all working. *touch wood*

as for the checkyesno, it checks any which are currently in the start_[pre]cmd
string itself, but not the functions they are in. (im still in two minds as to
adding the function parasing for them as the checks in a custom function
might have nothing to do with actually running the program).

please note: yesterday i moved to using a a list of varibles includeing the
ones in included files. but i might have missed something so some of the output
may be inconsistant (should only affect the -aA options). And because i changed
the include handling it does not currently clean up all memory it uses for its
lists.

 - Scott

ps. im off to work now and wont be back for at least 14 hours, so im not being
rude if someone does offer the ftp space and i dont reply until much later (:

 --------------------------------------
 sab@ansic.net  |  sab@zeekuschrist.com


On Fri, 31 Mar 2000, David Brownlee wrote:
>	We arrive at conflicting goals again:
>
>	    a) Be able to configure/read one file (rc.conf)
>
>	    b) Allow people with certain access to turn things on/off
>
>	and
>
>	    i) Installing packages enables them without extra work.
>
>	    ii) Enabling any package must involve sysadmin action.
>
>	Someone suggested a program to modify rc.conf - this seems to
>	have potential, what would people think of an 'rcctl':
>
>	    - list/edit/add/delete entries from rc.conf
>	    - setuid
>	    - reads /etc/rcctl.conf, which can define sets of users who
>	      have write permissions to certain variables, and defines
>	      whether pkgsrc should automatically enable on install
>	    - would have an option to parse all rc.d files and list any
>	      checkyesno entries which are not mentioned in rc.conf (and
>	      optionally add them in with an appropriate value).
>	      You could default all currently unset checkyesno variables to
>	      on with this.
>	    - Might be nice to list rc.d files that do not appear to check
>	      any checkyesno values
>
>	A non NetBSD style rc.d script would be automatically run on
>	startup/shutdown, which would be following the POLS.
>
>		David/absolute
>
>
>