Subject: Re: What about startup scripts??
To: Al B. Snell <alaric@alaric-snell.com>
From: Frederick Bruckman <fb@enteract.com>
List: tech-pkg
Date: 01/03/2001 09:57:49
On Wed, 3 Jan 2001, Al B. Snell wrote:

> On Tue, 2 Jan 2001, Frederick Bruckman wrote:
> > "/etc/rc.conf" and friends must be sourced before "rcorder" orders and
> > invokes the rc scripts. This is done BEFORE THE FILE-SYSTEMS ARE
> > MOUNTED, BEFORE THE NETWORK IS UP, in fact, while ROOT IS STILL
> > MOUNTED READ-ONLY. (Excuse my shouting.) If you want to share config
> > files between machines, you'll have to do it with "rsync" or "rdist".
>
> Dude! Read the messages!
>
> /etc/rc.conf is not in /usr or anything. It can be sourced before file
> systems are mounted. That's not a problem.
>
> "rcorder" does not execute the shell scripts - it doesn't care if they
> refer to config files in other partitions; the headers in the scripts'
> comments that rcorder reads will be used to make sure that all package
> scripts installed in there are started after relevant filesystems are
> mounted. Package scripts in /etc/rc.d source their own config file from
> /usr/pkg/etc.
>
> These scripts, we concurred earlier, should all source
> /usr/pkg/etc/rc.conf rather than having seperate config files.

No. Please look at some existing rc.d scripts, and at /etc/rc. The
rc.d scripts don't source config files. /etc/rc sources /etc/rc.conf,
which in turn sources /etc/defaults/rc.conf, and then /etc/rc calls
the shell function run_rc_script() over each script.

> /usr/pkg/etc/rc.conf, being a shell script, can contain conditionals on
> hostname, conditionals on a hypothetical 'hosttype' value stored in /etc
> for people running large clusters that can be subdivided nito groups, or
> it can just source /etc/rc.pkg.conf after setting up defaults, to allow
> for per-machine overrides.

That's exactly backwards. If you have a monolithic / and /usr, you
could source /usr/{pkg/,X11R6/,local/}etc/rc.conf in /etc/rc.conf, but
otherwise, it can't work.

-- 

Frederick