rc.d and ports

Mike Makonnen mtm at identd.net
Mon Feb 23 23:24:40 PST 2004


On Mon, Feb 23, 2004 at 11:46:23AM +0100, Oliver Eikemeier wrote:
> Mike Makonnen wrote:
> 
> >Hi,
> >
> >A lot of people have been calling to have ports startup scripts
> >integrated into rc.d. I have finally gotten arround to doing it.
> >Attached are the rc.d patches to make it work, but
> >I will need some cooperation from the ports folks.
> See PR 56736, there since Sep 2003:
>  <http://www.freebsd.org/cgi/query-pr.cgi?pr=conf/56736>
> 
> If you don't like it, please provide feedback what you think can be 
> improved.

It looks like you put some effort into it and I appreciate it, but
I'm sorry to say I don't like it at all. It really isn't any better than
the current situation. Basically your patches special case the ports
scripts and hack around rc.d mechanisms to make it
work with ports. This is wrong. If anything the ports should
be modified to fit in the already present rc.d mechanism.

> >
> >The makefile for the port should define a variable:
> >
> >RCVAR_NAME="fooport_enable"
> >
> >Then, logic similar to this should be inserted in the appropriate
> >bsd.port* makefile:
> >
> >if ! grep 1>/dev/null "\$${RCVAR_NAME}=" ${PREFIX}/etc/defaults/rc.conf ; 
> >then
> >        echo "${RCVAR_NAME}=NO" >> ${PREFIX}/etc/defaults/rc.conf
> >fi
> I guess we don't need this (and shouldn't do it, since 
> ${PREFIX}/etc/defaults/rc.conf
> might be read-only). Defaulting xxx_enable to "NO" seems to be sufficient, 
> with
> 
>  [ -z "$xxx_enable" ] && xxx_enable="NO"
> or
>  xxx_enable=${xxx_enable:-"NO"}
> before calling load_rc_config $name

Again, why special-case ports scripts ?

If the only thing people want is an xxx_enable, then the current scheme
is fine: Install the port script with xxx.sh-sample and when you want
to enable it just rename the file. But if the ports want to be able to
use the whole range of rc.d functionality, then ${PREFIX}/etc/defaults/rc.conf
is needed for all the other knobs that need to be defined.

Cheers.
-- 
Mike Makonnen  | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
mtm at identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8  5279 5359 2B82 7CD4 1F55
mtm at FreeBSD.Org| FreeBSD - Unleash the Daemon !


More information about the freebsd-arch mailing list