rc.d and ports
Oliver Eikemeier
eikemeier at fillmore-labs.com
Tue Feb 24 10:10:50 PST 2004
Oliver Eikemeier wrote:
> [...]
>
> I guess we agree here. I'll post a follow-up with uses
> ${PREFIX}/etc/{rc.conf,defaults/rc.conf,rc.conf.d} too. The problem here
> is that you'll have to support different prefixes, like /usr/X11R6.
Ok, before I send my next patch we should agree on the following:
If we assume the following rules:
i) defaults are overwritten by user editable files
ii) configuration in base overwrites configuration in prefix
iii) individual command configuration overwrites common configuration
where i) breaks ii) breaks iii), we get the following load order for a
port with name $_command and prefix $_prefix:
1. "$_prefix"/etc/defaults/rc.conf (read only, but unsure who may provide it)
2. /etc/defaults/rc.conf (read only, base system)
3. "$_prefix"/etc/defaults/rc.conf.d/"$_command" (read only, may be installed by the port)
4. "$_prefix"/etc/rc.conf (user editable)
5. "$_prefix"/etc/rc.conf.d/"$_command" (user editable)
6. /etc/rc.conf ( + /etc/rc.conf.local, both user editable)
7. /etc/rc.conf.d/"$_command" (user editable)
where we have to source /etc/defaults/rc.conf and /etc/rc.conf *every* time,
since we don't know whether other config files overwrite parts of them.
I suggest the syntax
load_rc_config "$_command" "$_prefix"
since the port knows where it lives, omitting the second argument for base
scripts.
Does everybody agree, or is a different load order more appropriate?
-Oliver
More information about the freebsd-arch
mailing list