Date: Tue, 21 Sep 2004 12:16:22 +0300 From: Giorgos Keramidas <keramida@freebsd.org> To: "David P. Discher" <dpd@dpdtech.com> Cc: freebsd-questions@freebsd.org Subject: Re: rcNG/rc_ng, using rcorder in /usr/local/etc/rc.d Message-ID: <20040921091622.GB4451@orion.daedalusnetworks.priv> In-Reply-To: <1292.69.27.32.26.1095707554.squirrel@webmail.dpdtech.com> References: <1292.69.27.32.26.1095707554.squirrel@webmail.dpdtech.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2004-09-20 14:12, "David P. Discher" <dpd@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040921091622.GB4451>