Subject: Re: Allowing ${name}_path to be set in "rc.conf", was Re: Keeping
To: Andrew Brown <atatat@atatdot.net>
From: Frederick Bruckman <fredb@immanent.net>
List: tech-userlevel
Date: 01/04/2002 18:56:26
On Fri, 4 Jan 2002, Andrew Brown wrote:

> getting back to the original point (this was the original point,
> wasn't it?), the /etc/rc.conf.d directory really is very useful.  my
> /etc/rc.conf contains this:
>
> 	sshd=pkgsrc
>
> and my /etc/rc.conf.d/sshd file contains this:
>
> 	if [ "$sshd" = pkgsrc ]; then
> 		sshd=YES
> 		command="/usr/pkg/sbin/${name}"
> 		required_files="/etc/${name}_config"
> 		start_precmd=:
> 		extra_commands="reload"
> 	fi
>
> and that's all i needed to do to use the sshd from pkgsrc instead of
> the openssh one.

Getting back to the subject... so if "pkgsrc" were to overwrite
/etc/rc.conf.d/* files, you would be one unhappy camper, wouldn't you?

> like to tweak.  the next step would be to provide overrides of those
> (eg, required_files, start_precmd, and extra_commands above).  one
> might later consider arguing that rc.subr could check for a value in
> the variable named ${name}_command and stuff the value from that into
> $command before continuing (etc)...but even that grows quickly out of
> hand.  using /etc/rc.conf.d for this works now, and has for a long
> time (afaict).

For "pkgsrc" purposes (and possibly for most purposes), permitting
${name}_path to be set in "/etc/rc.conf" would be enough. "sshd", for
example, could be changed to conform to the NetBSD naming scheme, or
else the rc.d script could conditionalize on detecting one version or
another, or else it could conditionalize on a flag, and then we could
leave "/etc/rc.conf.d" to the user.

Frederick