diff options
author | tg <tg@FreeBSD.org> | 2000-07-05 12:40:26 +0000 |
---|---|---|
committer | tg <tg@FreeBSD.org> | 2000-07-05 12:40:26 +0000 |
commit | 7f9b6cda1dde5ac288cb722cbef213ab80307826 (patch) | |
tree | 2fa19a2a1563a72f05c13a838b4c0779ecaf08a7 | |
parent | 40127f901879702a0de76787a4b9199112a337b7 (diff) | |
download | FreeBSD-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.
-rw-r--r-- | etc/rc.shutdown | 30 |
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 |