Subject: Re: What about startup scripts??
To: Frederick Bruckman <fb@enteract.com>
From: Gavan Fantom <gavan@coolfactor.org>
List: tech-pkg
Date: 01/08/2001 00:42:51
On Sun, 31 Dec 2000, Frederick Bruckman wrote:

> > 1) breaking out rcorder to run in two stages, stage 1, pre-usr, stage 2
> > post-usr.
>
> Sounds messy. At the very least, you'd need to break /etc/rc.d in two
> -- one directory to run solo, which ends with "mountall", and the
> second to be run together with /usr/{X11R6,pkg}/etc/rc.d. Then you
> have to deal with the fact that someone may have set X11PREFIX to
> /usr/X11R6-DRI, or LOCALBASE to /usr/local. Better if we can avoid all this.

I don't see why... surely the rcorder script could be improved to take a
few more options:

     -r      Add the specified keyword to the ``require list''. If any -r
             option is given, only those files necessary to provide the
             matching keyword are listed.

     -p      Treat the specified keyword as already provided. Dependencies
             on this keyword will not be considered.

(It's late, and I can't think whether that's enough to make rcorder -p
mountall ... ignore everything that happens before mountall, but that's
my intention)


Then you can do something along the lines of:


files=`rcorder -s nostart -r mountall /etc/rc.d/*`

for i in $files; do
        run_rc_script $i start
done

morefiles=`rcorder -s nostart -p mountall /etc/rc.d/* /usr/pkg/etc/rc.d/*`

for i in $morefiles; do
        run_rc_script $i start
done



Actually... not even sure -p is necessary... by the time we have /usr
mounted, we could just as well do:


morefiles=`rcorder -s nostart /etc/rc.d/* /usr/pkg/etc/rc.d/*`

for i in $morefiles; do
        if echo $files | grep -v -q $i
        then
                run_rc_script $i start
        fi
done


-- 
Gillette - the best a man can forget