From owner-freebsd-rc@FreeBSD.ORG Mon Jun 6 23:39:46 2005 Return-Path: X-Original-To: freebsd-rc@FreeBSD.org Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D1B8916A41C for ; Mon, 6 Jun 2005 23:39:46 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: from mail1.fluidhosting.com (mail1.fluidhosting.com [66.150.201.101]) by mx1.FreeBSD.org (Postfix) with SMTP id 65E7643D48 for ; Mon, 6 Jun 2005 23:39:46 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: (qmail 37418 invoked by uid 399); 6 Jun 2005 23:39:44 -0000 Received: from unknown (HELO ?192.0.35.182?) (dougb@dougbarton.net@192.0.35.182) by mail1.fluidhosting.com with SMTP; 6 Jun 2005 23:39:44 -0000 Message-ID: <42A4DEC0.3010404@FreeBSD.org> Date: Mon, 06 Jun 2005 16:39:44 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050326) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "J.R. Oldroyd" References: <20050603143803.GP886@linwhf.opal.com> <42A4CA37.1050201@FreeBSD.org> <20050606230850.GE37208@linwhf.opal.com> In-Reply-To: <20050606230850.GE37208@linwhf.opal.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-rc@FreeBSD.org Subject: Re: Use of rcorder for local rc.d/*.sh scripts X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2005 23:39:46 -0000 J.R. Oldroyd wrote: > On Jun 06, 15:12, Doug Barton wrote: > >>>If not, could we make the following change to /etc/rc.d/localpkg: >>> >>>--- localpkg.orig Fri Oct 8 13:52:43 2004 >>>+++ localpkg Thu Jun 2 16:53:56 2005 >>>@@ -36,7 +36,7 @@ >>> done >>> script_save_sep="$IFS" >>> IFS="${script_name_sep}" >>>- for script in ${slist}; do >>>+ for script in `rcorder -s nostart ${slist} 2>/dev/null`; do >> >>This is an interesting approach. I'm in favor of incorporating rcorder for >>local scripts (whether ports, or homegrown stuff), but I think I prefer an >>approach that brings all the scripts into the fray, so that local scripts >>that need to execute before parts of the base can do so. Have you put any >>thought into such an approach? >> > > > Yes, and I'd prefer that myself. > > We'd need to eliminate /etc/rc.d/localpkg and merge its functionality > into /etc/rc. > > The change would actually be trivial: > > --- /etc/rc Thu Jun 2 09:07:12 2005 > +++ rc.new Mon Jun 6 19:03:05 2005 > @@ -72,7 +72,23 @@ > > skip="-s nostart" > [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ] && skip="$skip -s nojail" > -files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null` > + > +# For each dir in $local_startup, search for init scripts matching *.sh > +# > +case ${local_startup} in > +[Nn][Oo] | '') > + ;; > +*) > + local_rc_files="" > + for dir in ${local_startup}; do > + if [ -d "${dir}" ]; then > + local_rc_files="${local_rc_files} ${dir}/*.sh" I like this, except I'd prefer to test -x than to use the *.sh idiom. We've always told people that in order for files to be run in local/rc.d that they need to be executable, and I (personal preference, not trying to dictate policy) would like to get away from having to name these startup scripts *.sh, as we've done in /etc/rc.d. Thoughts? > + fi > + done > + ;; > +esac > + > +files=`rcorder ${skip} /etc/rc.d/* ${local_rc_files} 2>/dev/null` > > for _rc_elem in ${files}; do > run_rc_script ${_rc_elem} ${_boot} > > > Also, a similar change for /etc/rc.shutdown. This is very cool! I would like to hear from some of the other -rc folks, especially Mike. Doug -- This .signature sanitized for your protection