On 10/23/14 21:36, worik wrote:
> "Processes local and package scripts in /etc/rc.d" is listed as the last
> thing rc does after boot.
> 
> What does "Processes" mean in this context?

like "processing food" -- do whatever needs to be done.
(not my best analogy, I'll admit)

But yeah. run the scripts that are indicated as needing to be run, they
do whatever they need to do.  USUALLY start daemons, but could be lots
of other things, too.

> Naively I would think this means that the scripts are all executed.  But
> that seems odd in this context as most of (all of?) the scripts take an
> argument that they pass to rc_cmd from rc.subr, and rc is not passing
> "start" to all those scripts.

why do you say that?
Look at the /etc/rc script...yes it does execute each of the rc.d
scripts, and yes it DOES pass "start" to them:

start_daemon()
{
        local _n
        for _n; do
                eval _do=\${${_n}_flags}
                if [ X"${_do}" != X"NO" ]; then
                        /etc/rc.d/${_n} start # <----- start!!
                fi
        done
}

now look how start_daemon is invoked...

> Looking at https://en.wikipedia.org/wiki/Init it seems my naive
> assumption is correct, but why run all those scripts?

um. because that's how we do it?

Before 4.9 or so...we hard-coded the startup process for each daemon in
/etc/rc, we decided to switch to the rc.d process for some additional
flexibility.

I'll admit I was dubious when it was first done, fearing we might be
heading down the idiotic "everything.d" directories that many Linux
distros are now doing, but it turns out I rather like it.

Nick.

Reply via email to