Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jun 2005 20:34:59 -0400
From:      "J.R. Oldroyd" <fbsd@opal.com>
To:        Brooks Davis <brooks@one-eyed-alien.net>
Cc:        freebsd-rc@freebsd.org
Subject:   Re: Use of rcorder for local rc.d/*.sh scripts
Message-ID:  <20050609003459.GK37208@linwhf.opal.com>
In-Reply-To: <20050608233802.GA29707@odin.ac.hmc.edu>
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>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Jun 08, 16:38, Brooks Davis wrote:
> 
> 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.
> 
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.
 
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.
> 
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="pkg_start"
 stop_cmd="pkg_stop"
 
+rcorder_opts=""
+[ `/sbin/sysctl -n security.jail.jailed` -eq 1 ] && rcorder_opts="-s nojail"
+
 pkg_start()
 {
 	# For each dir in $local_startup, search for init scripts matching *.sh
@@ -24,19 +27,14 @@
 	*)
 		echo -n 'Local package initialization:'
 		slist=""
-		if [ -z "${script_name_sep}" ]; then
-			script_name_sep=" "
-		fi
+		zlist=""
 		for dir in ${local_startup}; do
 			if [ -d "${dir}" ]; then
-				for script in ${dir}/*.sh; do
-					slist="${slist}${script_name_sep}${script}"
-				done
+				slist="${slist} ${dir}/[^0-9]*.sh"
+				zlist="${zlist} ${dir}/[0-9]*.sh"
 			fi
 		done
-		script_save_sep="$IFS"
-		IFS="${script_name_sep}"
-		for script in ${slist}; do
+		for script in ${zlist} `rcorder -s nostart ${rcorder_opts} ${slist} 2>/dev/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="${script_save_sep}"
 		echo '.'
 		;;
 	esac
@@ -61,26 +58,20 @@
 		;;
 	*)
 		slist=""
-		if [ -z "${script_name_sep}" ]; then
-			script_name_sep=" "
-		fi
+		zlist=""
 		for dir in ${local_startup}; do
 			if [ -d "${dir}" ]; then
-				for script in ${dir}/*.sh; do
-					slist="${slist}${script_name_sep}${script}"
-				done
+				slist="${slist} ${dir}/[^0-9]*.sh"
+				zlist="${zlist} ${dir}/[0-9]*.sh"
 			fi
 		done
-		script_save_sep="$IFS"
-		IFS="${script_name_sep}"
-		for script in `reverse_list ${slist}`; do
+		for script in `reverse_list ${zlist} \`rcorder -k shutdown ${rcorder_opts} ${slist} 2>/dev/null\``; do
 			if [ -x "${script}" ]; then
 				(set -T
 				trap 'exit 1' 2
 				${script} stop)
 			fi
 		done
-		IFS="${script_save_sep}"
 		echo '.'
 		;;
 	esac

[-- Attachment #2 --]
-----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-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050609003459.GK37208>