mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-11 14:10:34 +00:00
Now that the scripts in our ports support this, call the scripts
in ${local_startup} with the `stop' option on shutdown.
This commit is contained in:
parent
114c3c1ab8
commit
f873f0c768
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=62640
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user