Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Feb 2004 17:36:41 -0600
From:      "Scot W. Hetzel" <hetzelsw@westbend.net>
To:        "Thomas-Martin Seck" <tmseck-lists@netcologne.de>, <freebsd-ports@freebsd.org>
Subject:   Re: OPTIONS, LATEST_LINK, and RCng
Message-ID:  <068d01c3fa65$e5eaff50$cebe7726@westbend.net>
References:  <20040223212225.1766.qmail@laurel.tmseck.homedns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
From: "Thomas-Martin Seck" <tmseck-lists@netcologne.de>
> * Oliver Eikemeier <eikemeier@fillmore-labs.com>
[gmane.os.freebsd.devel.ports]:
>
> > Don't. This is no upgrade path, either use rcNG or not, but don't change
the
> > behaviour of your port based on other ports configuration. If you don't
like
> > rcNG, stick with the old script.
>
> Well, you can check in your start script whether /etc/rc.subr is present
> and act accordingly.  I will change squid to behave this way so it can
> use rcNG on a recent 5.x and "rc classic" on pre-5-system. I think this
> is acceptable, isn't it?
>

While, it will work, it causes the port-maintainer double duty, as they have
to maintain both the rcNG and the rcOLD portions of the script.  Just fully
convert your script to rcNG as we want to eventually get rid of all the
rcOLD scripts.  The rc_subr port is just a transition aid to allow these
scripts to run on pre-rcNG systems.

Before I submited the patches to bsd.port.mk for USE_RC_SUBR and provided
the port for rc_subr.  I was looking at the NetBSD tree to see how they had
transitioned from their old rc system to their new rc system (rcNG).  They
used a mix of both rcOLD and rcNG.  And I started converting my scripts to
follow the way NetBSD did it.   Then I looked at it again, and realized that
these scripts would need to be in the tree forever.  Also when anyone brings
a new port in and it needs an rc.d scripts, it would also require them to
use a mix of rcOLD and rcNG, so that they would stay compatible with
previous releases.  I determined that this mix of rcOLD and rcNG scripts
wasn't acceptable and came up with our current way of creating pure rcNG
scripts.

> > Besides, currently you get alphabetical order no matter what you do.
>
> Great. So rcNG is currently not even completely working for ports?
> Methinks that pulling in sysutils/rc_subr creates more problems than it
> solves. (Don't get me wrong: I really like rcNG, I just don't like the
> idea of a port being able to change the system startup -- and that is
> what rc_subr does).

No, pulling in sysutils/rc_subr solves more problems than you realize.

       1. It provides a common set of functions available to all rc.d
scripts (checkyesno, load_rc_config, run_rc_command, ...)
       2. It provides a common set of commands available to all rc.d scripts
(start/stop/restart/[status/poll]/[extra commands])

NOTE: sysutils/rc_subr is not a complete port of rcNG (it just allows rcNG
scripts to run on pre-rcNG systems).

The only change rc_subr does to the system startup is that it requires you
to add a ${name}_enable=yes to one of the rc.conf files (/etc/rc.conf,
/etc/rc.conf.local, or /etc/rc.conf.d/${name}).  Which is similar to what
some of the ports are currently doing, by requiring you to copy
${name}.sh-{dist,default, or sample} to ${name}.sh, before you could start
them.

The placing of the scripts in their proper order is the job of /sbin/rcorder
(only on 5.x+).  Rcorder functions by reading the comments in a rc.d script
for specific keywords in order for it to determine in which order to place
the script.  Currently, rcorder is not being used on -Current to start the
ports startup scripts because only a small portion of them have been
converted.

NOTE: rcorder of the ports startup scripts is planed for -Current, but they
are waiting for the ports scripts to be converted.

Scot



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?068d01c3fa65$e5eaff50$cebe7726>