Subject: Re: Allowing ${name}_path to be set in "rc.conf", was Re: Keeping /etc/defaults and /etc/rc.d in-sync
To: Frederick Bruckman <fredb@immanent.net>
From: Andrew Brown <atatat@atatdot.net>
List: tech-userlevel
Date: 01/04/2002 20:12:05
>> 	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?

well...i'd like to think that if i decided to update (or change) my
ssh pkg, i'd remember that i did this bit beforehand.  if not, i'd
kick myself.

>> 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.

well...almost.  the pkgsrc sshd doesn't use or need the same files in
/etc that the openssh stuff needs, so there's more than just the
command you'd need to tweak in order to get them to change places
easily.  hence my other settings in /etc/rc.conf.d/sshd.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."