summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
authorroam <roam@FreeBSD.org>2001-07-17 14:33:52 +0000
committerroam <roam@FreeBSD.org>2001-07-17 14:33:52 +0000
commit401d22d5acee4b9bc0c74739f992fb8f62e4c561 (patch)
tree9fef42fdf84f81215cb419505174d2afc7f4f1d6 /etc/rc
parentf2e49729a0baf1d3bdd3bf9fab3b3737216e7a4a (diff)
downloadFreeBSD-src-401d22d5acee4b9bc0c74739f992fb8f62e4c561.zip
FreeBSD-src-401d22d5acee4b9bc0c74739f992fb8f62e4c561.tar.gz
Add a script_name_sep rc.conf knob to specify the IFS character
for separating the startup scripts' list into individual filenames. Run the shutdown scripts in reverse alphabetical order, so dependent services are stopped before the services they depend upon. Reviewed by: -arch, -audit MFC after: 3 weeks
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc17
1 files changed, 12 insertions, 5 deletions
diff --git a/etc/rc b/etc/rc
index bc8c915..e77b260 100644
--- a/etc/rc
+++ b/etc/rc
@@ -793,17 +793,24 @@ case ${local_startup} in
;;
*)
echo -n 'Local package initialization:'
+ slist=""
for dir in ${local_startup}; do
if [ -d "${dir}" ]; then
for script in ${dir}/*.sh; do
- if [ -x "${script}" ]; then
- (set -T
- trap 'exit 1' 2
- ${script} start)
- fi
+ slist="${slist}${script_name_sep}${script}"
done
fi
done
+ script_save_sep="$IFS"
+ IFS="${script_name_sep}"
+ for script in ${slist}; do
+ if [ -x "${script}" ]; then
+ (set -T
+ trap 'exit 1' 2
+ ${script} start)
+ fi
+ done
+ IFS="${script_save_sep}"
echo '.'
;;
esac
OpenPOWER on IntegriCloud