aboutsummaryrefslogtreecommitdiff
path: root/etc/rc.d
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2005-12-02 20:06:07 +0000
committerDoug Barton <dougb@FreeBSD.org>2005-12-02 20:06:07 +0000
commit0f3ce2b32c1dd5e82c838030e87f1f868cf58af9 (patch)
tree51bcd0baa3852d62ab93efd232c48f0a2015ed8a /etc/rc.d
parent0eeba503f696d3f00afb37b2c0d6f09011e90d04 (diff)
downloadsrc-0f3ce2b32c1dd5e82c838030e87f1f868cf58af9.tar.gz
src-0f3ce2b32c1dd5e82c838030e87f1f868cf58af9.zip
Introduce startup scripts from the local_startup directories to
the base rcorder. This is accomplished by running rcorder twice, first to get all the disks mounted (through mountcritremote), then again to include the local_startup directories. This dramatically changes the behavior of rc.d/localpkg, as all "local" scripts that have the new rc.d semantics are now run in the base rcorder, so only scripts that have not been converted yet will run in rc.d/localpkg. Make a similar change in rc.shutdown, and add some functions in rc.subr to support these changes. Bump __FreeBSD_version to reflect this change.
Notes
Notes: svn path=/head/; revision=153027
Diffstat (limited to 'etc/rc.d')
-rw-r--r--etc/rc.d/localpkg37
1 files changed, 5 insertions, 32 deletions
diff --git a/etc/rc.d/localpkg b/etc/rc.d/localpkg
index c4ade879024b..0eba5239fa1c 100644
--- a/etc/rc.d/localpkg
+++ b/etc/rc.d/localpkg
@@ -23,29 +23,16 @@ pkg_start()
;;
*)
echo -n 'Local package initialization:'
- slist=""
- if [ -z "${script_name_sep}" ]; then
- script_name_sep=" "
- fi
- for dir in ${local_startup}; do
- if [ -d "${dir}" ]; then
- for script in ${dir}/*.sh; do
- slist="${slist}${script_name_sep}${script}"
- done
- fi
- done
- script_save_sep="$IFS"
- IFS="${script_name_sep}"
- for script in ${slist}; do
+ find_local_scripts_old
+ for script in ${zlist} ${slist}; do
if [ -x "${script}" ]; then
(set -T
trap 'exit 1' 2
${script} start)
elif [ -f "${script}" -o -L "${script}" ]; then
- echo -n " (skipping ${script##*/}, not executable)"
+ echo -n " (skipping ${script}, not executable)"
fi
done
- IFS="${script_save_sep}"
echo '.'
;;
esac
@@ -53,33 +40,19 @@ pkg_start()
pkg_stop()
{
- # For each dir in $local_startup, search for init scripts matching *.sh
case ${local_startup} in
[Nn][Oo] | '')
;;
*)
echo -n 'Shutting down daemon processes:'
- slist=""
- if [ -z "${script_name_sep}" ]; then
- script_name_sep=" "
- fi
- for dir in ${local_startup}; do
- if [ -d "${dir}" ]; then
- for script in ${dir}/*.sh; do
- slist="${slist}${script_name_sep}${script}"
- done
- fi
- done
- script_save_sep="$IFS"
- IFS="${script_name_sep}"
- for script in `reverse_list ${slist}`; do
+ find_local_scripts_old
+ for script in `reverse_list ${slist} ${zlist}`; do
if [ -x "${script}" ]; then
(set -T
trap 'exit 1' 2
${script} stop)
fi
done
- IFS="${script_save_sep}"
echo '.'
;;
esac