Browse Source

re-do shutdown operations. Run the scripts if we may; take down carp

unconditionally, and then do the optional powerdown
discussed at length with rpe
OPENBSD_5_5
deraadt 11 years ago
parent
commit
c4a6c88868
1 changed files with 23 additions and 23 deletions
  1. +23
    -23
      src/etc/rc

+ 23
- 23
src/etc/rc View File

@ -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


Loading…
Cancel
Save