--- /etc/init.d/halt.sh 2002-06-03 11:34:59.000000000 -0400 +++ halt.sh 2002-06-25 16:13:15.000000000 -0400 @@ -2,20 +2,23 @@ # Distributed under the terms of the GNU General Public License, v2 or later # $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/halt.sh,v 1.14 2002/03/23 08:14:40 azarah Exp $ +if checkserver +then + #we try to deactivate swap on the server + # first because it seems to need devfsd running + # to work. The TERM and KILL stuff will zap devfsd, so... -#we try to deactivate swap first because it seems to need devfsd running -#to work. The TERM and KILL stuff will zap devfsd, so... - -ebegin "Deactivating swap" -swapoff -a &>/dev/null -eend $? + ebegin "Deactivating swap" + swapoff -a &>/dev/null + eend $? -#we need to properly terminate devfsd to save the permissions -if [ "$(ps -A |grep devfsd)" ] -then + #we need to properly terminate devfsd to save the permissions + if [ "$(ps -A |grep devfsd)" ] + then ebegin "Stopping devfsd" killall -15 devfsd &>/dev/null eend $? + fi fi ebegin "Sending all processes the TERM signal" @@ -92,13 +95,15 @@ eend $? "Failed to shut LVM down" fi -ebegin "Remounting remaining filesystems readonly" -#get better results with a sync and sleep -sync;sync -sleep 2 -umount -a -r -n -t nodevfs,noproc,notmpfs &>/dev/null -if [ "$?" -ne 0 ] +if checkserver then + ebegin "Remounting remaining filesystems readonly" + #get better results with a sync and sleep + sync;sync + sleep 2 + umount -a -r -n -t nodevfs,noproc,notmpfs &>/dev/null + if [ "$?" -ne 0 ] + then killall5 -9 &>/dev/null umount -a -r -n -l -d -f -t nodevfs,noproc &>/dev/null if [ "$?" -ne 0 ] @@ -109,7 +114,24 @@ else eend 0 fi + else + eend 0 + fi else + ebegin "Remounting remaining filesystems readonly" + #get better results with a sync and sleep + sync;sync + sleep 2 + umount -a -r -n -t nodevfs,noproc,notmpfs &>/dev/null + if [ "$?" -ne 0 ] + then + killall5 -9 &>/dev/null + umount -a -r -n -l -d -f -t nodevfs,noproc &>/dev/null + if [ "$?" -ne 0 ] + then + sync; sync + fi + fi eend 0 fi