|
@ -1,4 +1,4 @@ |
|
|
# $OpenBSD: rc,v 1.412 2013/12/27 04:21:48 deraadt Exp $ |
|
|
|
|
|
|
|
|
# $OpenBSD: rc,v 1.413 2013/12/27 22:15:40 deraadt Exp $ |
|
|
|
|
|
|
|
|
# System startup script run by init on autoboot |
|
|
# System startup script run by init on autoboot |
|
|
# or after single-user. |
|
|
# or after single-user. |
|
@ -233,33 +233,33 @@ if [ X"$1" = X"shutdown" ]; then |
|
|
dd if=/dev/random of=/var/db/host.random bs=65536 count=1 >/dev/null 2>&1 |
|
|
dd if=/dev/random of=/var/db/host.random bs=65536 count=1 >/dev/null 2>&1 |
|
|
chmod 600 /var/db/host.random >/dev/null 2>&1 |
|
|
chmod 600 /var/db/host.random >/dev/null 2>&1 |
|
|
_c=$? |
|
|
_c=$? |
|
|
if [ ${_c} -eq 0 -a -n "${pkg_scripts}" ]; then |
|
|
|
|
|
echo -n 'stopping package daemons:' |
|
|
|
|
|
while [ -n "${pkg_scripts}" ]; do |
|
|
|
|
|
_r=${pkg_scripts##* } |
|
|
|
|
|
pkg_scripts=${pkg_scripts%%*( )${_r}} |
|
|
|
|
|
[ -x /etc/rc.d/${_r} ] && /etc/rc.d/${_r} stop |
|
|
|
|
|
done |
|
|
|
|
|
echo '.' |
|
|
|
|
|
fi |
|
|
|
|
|
if [ ${_c} -eq 0 -a -f /etc/rc.shutdown ]; then |
|
|
|
|
|
|
|
|
if [ ${_c} -eq 0 ]; then |
|
|
|
|
|
if [ -n "${pkg_scripts}" ]; then |
|
|
|
|
|
echo -n 'stopping package daemons:' |
|
|
|
|
|
while [ -n "${pkg_scripts}" ]; do |
|
|
|
|
|
_r=${pkg_scripts##* } |
|
|
|
|
|
pkg_scripts=${pkg_scripts%%*( )${_r}} |
|
|
|
|
|
[ -x /etc/rc.d/${_r} ] && /etc/rc.d/${_r} stop |
|
|
|
|
|
done |
|
|
|
|
|
echo '.' |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
echo /etc/rc.shutdown in progress... |
|
|
echo /etc/rc.shutdown in progress... |
|
|
. /etc/rc.shutdown |
|
|
. /etc/rc.shutdown |
|
|
echo /etc/rc.shutdown complete. |
|
|
echo /etc/rc.shutdown complete. |
|
|
|
|
|
else |
|
|
|
|
|
echo single user: not running shutdown scripts |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
# bring carp interfaces down gracefully |
|
|
|
|
|
ifconfig | while read a b; do |
|
|
|
|
|
case $a in |
|
|
|
|
|
carp+([0-9]):) ifconfig ${a%:} down ;; |
|
|
|
|
|
esac |
|
|
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
if [ X"${powerdown}" = X"YES" ]; then |
|
|
|
|
|
exit 2 |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
# bring carp interfaces down gracefully |
|
|
|
|
|
ifconfig | while read a b; do |
|
|
|
|
|
case $a in |
|
|
|
|
|
carp+([0-9]):) ifconfig ${a%:} down ;; |
|
|
|
|
|
esac |
|
|
|
|
|
done |
|
|
|
|
|
|
|
|
else |
|
|
|
|
|
echo single user: not running /etc/rc.shutdown |
|
|
|
|
|
|
|
|
if [ X"${powerdown}" = X"YES" ]; then |
|
|
|
|
|
exit 2 |
|
|
fi |
|
|
fi |
|
|
exit 0 |
|
|
exit 0 |
|
|
fi |
|
|
fi |
|
|