rcNG/rc_ng, using rcorder in /usr/local/etc/rc.d

Giorgos Keramidas keramida at freebsd.org
Tue Sep 21 02:16:52 PDT 2004


On 2004-09-20 14:12, "David P. Discher" <dpd at dpdtech.com> wrote:
>
> Learn something new every day, just learning the internals of
> FreeBSD-5.2.1 (have been sticking to the 4.x-STABLEs) and rolling out my
> first 5.x system.
>
> rcNG is really nice, but where is rcorder being kicked off on
> /usr/local/etc/rc.d to use rcNG...
>
> I  see that /etc/rc.d/localpkg is still skimming for *.sh and running
> them, and not doing the rcorder method.

Correct.  The rcorder method is used only for /etc/rc.d scripts.  See:

    $ grep -n rcorder /etc/rc
    71:files=`rcorder -k ${os} ${skip} /etc/rc.d/* 2>/dev/null`

You'd have to patch localpkg with something like this to add rcorder support:

% Index: localpkg
% ===================================================================
% RCS file: /home/ncvs/src/etc/rc.d/localpkg,v
% retrieving revision 1.4
% diff -u -r1.4 localpkg
% --- localpkg  28 Jul 2004 00:09:18 -0000      1.4
% +++ localpkg  21 Sep 2004 09:10:13 -0000
% @@ -36,7 +36,8 @@
%               done
%               script_save_sep="$IFS"
%               IFS="${script_name_sep}"
% -             for script in ${slist}; do
% +             olist=`rcorder -k ${os} ${slist} 2>/dev/null`
% +             for script in ${olist}; do
%                       if [ -x "${script}" ]; then
%                               (set -T
%                               trap 'exit 1' 2
% @@ -73,7 +74,8 @@
%               done
%               script_save_sep="$IFS"
%               IFS="${script_name_sep}"
% -             for script in `reverse_list ${slist}`; do
% +             olist=`rcorder -k ${os} ${slist} 2>/dev/null`
% +             for script in `reverse_list ${olist}`; do
%                       if [ -x "${script}" ]; then
%                               (set -T
%                               trap 'exit 1' 2

This will order the ${slist} list of scripts just before running them.

Note that this list will contain scripts from ALL the different
directories you've added to local_startup.  If you want to order the
scripts of each directory separately, you'd have to order the scripts
per directory before adding them to ${slist}:

% Index: localpkg
% ===================================================================
% RCS file: /home/ncvs/src/etc/rc.d/localpkg,v
% retrieving revision 1.4
% diff -u -r1.4 localpkg
% --- localpkg  28 Jul 2004 00:09:18 -0000      1.4
% +++ localpkg  21 Sep 2004 09:14:47 -0000
% @@ -29,7 +29,8 @@
%               fi
%               for dir in ${local_startup}; do
%                       if [ -d "${dir}" ]; then
% -                             for script in ${dir}/*.sh; do
% +                             flist=`rcorder -k ${os} ${dir}/*.sh 2>/dev/null`
% +                             for script in ${flist}; do
%                                       slist="${slist}${script_name_sep}${script}"
%                               done
%                       fi
% @@ -66,7 +67,8 @@
%               fi
%               for dir in ${local_startup}; do
%                       if [ -d "${dir}" ]; then
% -                             for script in ${dir}/*.sh; do
% +                             flist=`rcorder -k ${os} ${dir}/*.sh 2>/dev/null`
% +                             for script in ${flist}; do
%                                       slist="${slist}${script_name_sep}${script}"
%                               done
%                       fi


More information about the freebsd-questions mailing list