diff --git a/src/etc/rc b/src/etc/rc index f136d4d5..961052b6 100644 --- a/src/etc/rc +++ b/src/etc/rc @@ -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 # 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 chmod 600 /var/db/host.random >/dev/null 2>&1 _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... . /etc/rc.shutdown 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 exit 0 fi