From owner-freebsd-questions@FreeBSD.ORG Tue Sep 21 09:16:52 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 183F816A4CE for ; Tue, 21 Sep 2004 09:16:52 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D43443D1D for ; Tue, 21 Sep 2004 09:16:51 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from orion.daedalusnetworks.priv (host5.bedc.ondsl.gr [62.103.39.229])i8L9GYIr020149; Tue, 21 Sep 2004 12:16:39 +0300 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) i8L9GNWW004716; Tue, 21 Sep 2004 12:16:23 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost)i8L9GMWm004715; Tue, 21 Sep 2004 12:16:22 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Tue, 21 Sep 2004 12:16:22 +0300 From: Giorgos Keramidas To: "David P. Discher" Message-ID: <20040921091622.GB4451@orion.daedalusnetworks.priv> References: <1292.69.27.32.26.1095707554.squirrel@webmail.dpdtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1292.69.27.32.26.1095707554.squirrel@webmail.dpdtech.com> cc: freebsd-questions@freebsd.org Subject: Re: rcNG/rc_ng, using rcorder in /usr/local/etc/rc.d X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2004 09:16:52 -0000 On 2004-09-20 14:12, "David P. Discher" 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