summaryrefslogtreecommitdiffstats
path: root/etc/rc.shutdown
diff options
context:
space:
mode:
authortg <tg@FreeBSD.org>2000-07-05 12:40:26 +0000
committertg <tg@FreeBSD.org>2000-07-05 12:40:26 +0000
commit7f9b6cda1dde5ac288cb722cbef213ab80307826 (patch)
tree2fa19a2a1563a72f05c13a838b4c0779ecaf08a7 /etc/rc.shutdown
parent40127f901879702a0de76787a4b9199112a337b7 (diff)
downloadFreeBSD-src-7f9b6cda1dde5ac288cb722cbef213ab80307826.zip
FreeBSD-src-7f9b6cda1dde5ac288cb722cbef213ab80307826.tar.gz
Now that the scripts in our ports support this, call the scripts
in ${local_startup} with the `stop' option on shutdown.
Diffstat (limited to 'etc/rc.shutdown')
-rw-r--r--etc/rc.shutdown30
1 files changed, 29 insertions, 1 deletions
diff --git a/etc/rc.shutdown b/etc/rc.shutdown
index 5492d89..0d93bcf 100644
--- a/etc/rc.shutdown
+++ b/etc/rc.shutdown
@@ -17,6 +17,15 @@ HOME=/
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin
export HOME PATH
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/rc.conf ]; then
+ . /etc/defaults/rc.conf
+ source_rc_confs
+elif [ -r /etc/rc.conf ]; then
+ . /etc/rc.conf
+fi
+
# Check if /var/db/mounttab is clean.
case $1 in
reboot)
@@ -28,8 +37,27 @@ esac
echo -n "Shutting down daemon processes: "
-# Insert shutdown procedures here
+# for each valid dir in $local_startup, search for init scripts matching *.sh
+case ${local_startup} in
+[Nn][Oo] | '')
+ ;;
+*)
+ 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} stop)
+ fi
+ done
+ fi
+ done
+ echo .
+ ;;
+esac
+# Insert other shutdown procedures here
echo '.'
exit 0
OpenPOWER on IntegriCloud