From owner-freebsd-rc@FreeBSD.ORG Thu Jun 9 00:35:13 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 EBFA516A41C; Thu, 9 Jun 2005 00:35:13 +0000 (GMT) (envelope-from jr@opal.com) Received: from smtp.vzavenue.net (smtp.vzavenue.net [66.171.59.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5969C43D58; Thu, 9 Jun 2005 00:35:12 +0000 (GMT) (envelope-from jr@opal.com) Received: from linwhf.opal.com (112.79.171.66.subscriber.vzavenue.net [66.171.79.112]) by smtp.vzavenue.net (MOS 3.4.8-GR) with ESMTP id CJB20781; Wed, 8 Jun 2005 20:35:00 -0400 (EDT) Received: from ASSP-nospam (localhost [127.0.0.1]) by linwhf.opal.com (8.13.3/8.13.3) with ESMTP id j590YxvY065544; Wed, 8 Jun 2005 20:34:59 -0400 (EDT) (envelope-from jr@opal.com) Received: from 127.0.0.1 ([127.0.0.1] helo=linwhf.opal.com) by ASSP-nospam ; 9 Jun 05 00:34:59 -0000 Received: (from jr@localhost) by linwhf.opal.com (8.13.3/8.13.3/Submit) id j590YxIi065543; Wed, 8 Jun 2005 20:34:59 -0400 (EDT) (envelope-from jr) Date: Wed, 8 Jun 2005 20:34:59 -0400 From: "J.R. Oldroyd" To: Brooks Davis Message-ID: <20050609003459.GK37208@linwhf.opal.com> References: <20050603143803.GP886@linwhf.opal.com> <42A4CA37.1050201@FreeBSD.org> <20050606235426.GA10526@odin.ac.hmc.edu> <20050607001447.GG37208@linwhf.opal.com> <20050607003142.GD10526@odin.ac.hmc.edu> <20050607033536.GH37208@linwhf.opal.com> <20050607160855.GO37208@linwhf.opal.com> <20050607173741.GI11758@odin.ac.hmc.edu> <20050607191109.GU37208@linwhf.opal.com> <20050608233802.GA29707@odin.ac.hmc.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pWOmaDnDlrCGjNh4" Content-Disposition: inline In-Reply-To: <20050608233802.GA29707@odin.ac.hmc.edu> User-Agent: Mutt/1.4.2.1i X-Junkmail-Status: score=0/50, host=smtp.vzavenue.net 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: Thu, 09 Jun 2005 00:35:14 -0000 --pWOmaDnDlrCGjNh4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jun 08, 16:38, Brooks Davis wrote: >=20 > What I like about the localpkg hack is that it doesn't change much. I > think you have solutions to most of my concerns though. My gut feeling > is that full integration of /usr/local in rcorder is not feasible for > 6.0, but localpkg with rcorder should be. Remember, feature freeze is > nominally Friday. My suggestion would be to push for the localpkg hack > and the port changes it requires for 6.0 so ports can depend on > each other's services with the plan of doing full integration in 7.0. > That would get the most critical feature working now and give us over a > year to shake out any issues with full ordering. After a good period of > settling, I think we could even MFC the localpkg hack to 5.x, probably in > time for 5.5. If that, happened, I think we'd be able to fully mandate > rc.d style scripts for 7.0 because all supported versions of FreeBSD > would run rcorder on their scripts. >=20 I have yet another diff to localpkg, this one explicitly creates two lists, one for [^0-9]*.sh files and the other for [0-9]*.sh files. It then uses rcorder to sort the non-numeric-named ones, prepends the numeric-named ones and runs them. This retains existing 000.foo.sh functionality and makes it, I believe, so that no port changes are needed! It's below. =20 OK, so what needs to be done next in terms of "push[ing] for the localpkg hack and the port changes it requires" before Friday? To whom should I send this? > BTW, thanks for working on this. It's a feature I've been wanting for > some time now. As always the devil is the details. >=20 You're welcome. -jr --- /etc/rc.d/localpkg.orig Fri Oct 8 13:52:43 2004 +++ /etc/rc.d/localpkg Tue Jun 7 15:19:19 2005 @@ -14,6 +14,9 @@ start_cmd=3D"pkg_start" stop_cmd=3D"pkg_stop" =20 +rcorder_opts=3D"" +[ `/sbin/sysctl -n security.jail.jailed` -eq 1 ] && rcorder_opts=3D"-s noj= ail" + pkg_start() { # For each dir in $local_startup, search for init scripts matching *.sh @@ -24,19 +27,14 @@ *) echo -n 'Local package initialization:' slist=3D"" - if [ -z "${script_name_sep}" ]; then - script_name_sep=3D" " - fi + zlist=3D"" for dir in ${local_startup}; do if [ -d "${dir}" ]; then - for script in ${dir}/*.sh; do - slist=3D"${slist}${script_name_sep}${script}" - done + slist=3D"${slist} ${dir}/[^0-9]*.sh" + zlist=3D"${zlist} ${dir}/[0-9]*.sh" fi done - script_save_sep=3D"$IFS" - IFS=3D"${script_name_sep}" - for script in ${slist}; do + for script in ${zlist} `rcorder -s nostart ${rcorder_opts} ${slist} 2>/d= ev/null`; do if [ -x "${script}" ]; then (set -T trap 'exit 1' 2 @@ -45,7 +43,6 @@ echo -n " (skipping ${script##*/}, not executable)" fi done - IFS=3D"${script_save_sep}" echo '.' ;; esac @@ -61,26 +58,20 @@ ;; *) slist=3D"" - if [ -z "${script_name_sep}" ]; then - script_name_sep=3D" " - fi + zlist=3D"" for dir in ${local_startup}; do if [ -d "${dir}" ]; then - for script in ${dir}/*.sh; do - slist=3D"${slist}${script_name_sep}${script}" - done + slist=3D"${slist} ${dir}/[^0-9]*.sh" + zlist=3D"${zlist} ${dir}/[0-9]*.sh" fi done - script_save_sep=3D"$IFS" - IFS=3D"${script_name_sep}" - for script in `reverse_list ${slist}`; do + for script in `reverse_list ${zlist} \`rcorder -k shutdown ${rcorder_opt= s} ${slist} 2>/dev/null\``; do if [ -x "${script}" ]; then (set -T trap 'exit 1' 2 ${script} stop) fi done - IFS=3D"${script_save_sep}" echo '.' ;; esac --pWOmaDnDlrCGjNh4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iQDVAwUBQqeOskkkqUax7f6FAQKnvAX/Uq+0+oe0LOmKcesqZa8mtBVG3PLt1zYJ UJklV2oE5zCihfJrEJIEtZ9I/yPd99uRQJaZzOhe+pUufkFkoNRh/etdQvqs28xq G010VNjXSkhrYCVtSS33g3ccKgDT3OtcehbWqoA9A4ANrhPsetlH3eWmRIXmNcg1 sOWC8GYFHmRm7BN5k4e60hDuPskey+MBmBwv9p8WueohVz79j2q18fAtaBAtZr1f 18nz2wkSRA7TEe7WaiHqkPZLFU08ruPg =A4li -----END PGP SIGNATURE----- --pWOmaDnDlrCGjNh4--