Removal of the old rc system from -current

Peter Pentchev roam at ringlet.net
Tue Apr 29 10:28:10 PDT 2003


On Tue, Apr 29, 2003 at 12:03:21PM -0500, Scot W. Hetzel wrote:
> From: "Peter Pentchev" <roam at ringlet.net>
> > From "Scot W. Hetzel"
> >> I started porting my ports rc scripts to work on both rcNG and rcOG
> systems.
> >>In this process I found the ideal solution for the ports rc.d script:
> >>
> >>    1. define default port variables in the script
> >>    2. check for /etc/rc.subr
> >>        a. if rc.subr exists, use rcNG style
> >>        b. if rc.subr not exists
> >>            1. source /etc/defaults/rc.conf (or /etc/rc.conf)
> >>            2. use rcOG style
> >
> >Actually, this ought to be more like:
> >b. if rc.subr does not exist
> >1. source /etc/defaults/rc.conf
> >2. if the source_rc_confs function exists, execute it
> >3. if the source_rc_confs function does not exist,
> >   try to emulate it by checking for the files listed
> >   in the rc_conf_files variable and sourcing them if
> >   they exist.
> 
> This is what I have in the rcOG portion of the script to bring in the
> rc.conf settings:
> 
>         # Suck in the configuration variables.
>         if [ -z "${source_rc_confs_defined}" ]; then
>                 if [ -r /etc/defaults/rc.conf ]; then
>                         . /etc/defaults/rc.conf
>                         source_rc_confs
>                 elif [ -r /etc/rc.conf ]; then
>                         . /etc/rc.conf
>                 fi
>         fi
> 
> Any changes I should make to it?

None that I can think of, actually.  The only issue that bothers
me somewhat is that the above might miss an /etc/rc.conf.local;
however, if /etc/defaults/rc.conf does not have source_rc_confs_defined,
then we are clearly not on any reasonably recent FreeBSD system,
so I don't know whether any assumptions should be made about the
existence and relevance of /etc/rc.conf.local.  On any reasonably
recent FreeBSD system with rcOG, source_rc_confs_defined would be
defined, and source_rc_confs() should take care of all the conf files.

G'luck,
Peter

-- 
Peter Pentchev	roam at ringlet.net    roam at sbnd.net    roam at FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
Thit sentence is not self-referential because "thit" is not a word.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20030429/a41acca2/attachment.bin


More information about the freebsd-arch mailing list