Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Feb 2004 19:10:30 +0100
From:      Oliver Eikemeier <eikemeier@fillmore-labs.com>
To:        Mike Makonnen <mtm@identd.net>, freebsd-arch@FreeBSD.org
Subject:   Re: rc.d and ports
Message-ID:  <403B9396.8020404@fillmore-labs.com>
In-Reply-To: <403B403C.7040701@fillmore-labs.com>
References:  <20040223084146.GA4202@mobile.acs-et.com> <4039D9FF.40208@fillmore-labs.com> <20040224072401.GB1125@mobile.acs-et.com> <403B206B.7000101@fillmore-labs.com> <20040224103932.GA20467@mobile.acs-et.com> <403B403C.7040701@fillmore-labs.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?403B9396.8020404>