--- /etc/init.d/halt 2006-01-12 17:09:59.000000000 +0100 +++ /mnt/livecd/etc/init.d/halt 2006-11-22 09:05:29.000000000 +0100 @@ -125,90 +125,90 @@ [ -x /sbin/quotaoff ] && runcmd $"Turning off quotas: " /sbin/quotaoff -aug -# Unmount file systems, killing processes if we have to. -# Unmount loopback stuff first -remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts` -devremaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $1}' /proc/mounts` -[ -n "$remaining" ] && { - sig= - retry=3 - while [ -n "$remaining" -a "$retry" -gt 0 ] - do - if [ "$retry" -lt 3 ]; then - runcmd $"Unmounting loopback filesystems (retry):" umount $remaining - else - runcmd $"Unmounting loopback filesystems: " umount $remaining - fi - for dev in $devremaining ; do - losetup $dev > /dev/null 2>&1 && \ - runcmd $"Detaching loopback device $dev: " losetup -d $dev - done - remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts` - devremaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $1}' /proc/mounts` - [ -z "$remaining" ] && break - /sbin/fuser -k -m $sig $remaining >/dev/null - sleep 5 - retry=$(($retry -1)) - sig=-9 - done -} +## Unmount file systems, killing processes if we have to. +## Unmount loopback stuff first +#remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts` +#devremaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $1}' /proc/mounts` +#[ -n "$remaining" ] && { +# sig= +# retry=3 +# while [ -n "$remaining" -a "$retry" -gt 0 ] +# do +# if [ "$retry" -lt 3 ]; then +# runcmd $"Unmounting loopback filesystems (retry):" umount $remaining +# else +# runcmd $"Unmounting loopback filesystems: " umount $remaining +# fi +# for dev in $devremaining ; do +# losetup $dev > /dev/null 2>&1 && \ +# runcmd $"Detaching loopback device $dev: " losetup -d $dev +# done +# remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts` +# devremaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $1}' /proc/mounts` +# [ -z "$remaining" ] && break +# /sbin/fuser -k -m $sig $remaining >/dev/null +# sleep 5 +# retry=$(($retry -1)) +# sig=-9 +# done +#} # Unmount RPC pipe file systems -sig= -retry=3 -remaining=`awk '!/^#/ && $3 ~ /^rpc_pipefs$/ || $3 ~ /^rpc_svc_gss_pipefs$/ {print $2}' /proc/mounts` - -while [ -n "$remaining" -a "$retry" -gt 0 ] -do - if [ "$retry" -lt 3 ]; then - runcmd $"Unmounting pipe file systems (retry): " umount -f $remaining - else - runcmd $"Unmounting pipe file systems: " umount -f $remaining - fi - sleep 2 - remaining=`awk '!/^#/ && $3 ~ /^rpc_pipefs$/ || $3 ~ /^rpc_svc_gss_pipefs$/ {print $2}' /proc/mounts` - [ -z "$remaining" ] && break - /sbin/fuser -k -m $sig $remaining >/dev/null - sleep 5 - retry=$(($retry-1)) - sig=-9 -done - -sig= -retry=3 -remaining=`halt_get_remaining | sort -r` - -while [ -n "$remaining" -a "$retry" -gt 0 ] -do - if [ "$retry" -lt 3 ]; then - LANG=C runcmd $"Unmounting file systems (retry): " umount -f $remaining - else - LANG=C runcmd $"Unmounting file systems: " umount -f $remaining - fi - sleep 2 - remaining=`halt_get_remaining | sort -r` - [ -z "$remaining" ] && break - /sbin/fuser -k -m $sig $remaining >/dev/null - sleep 5 - retry=$(($retry-1)) - sig=-9 -done -[ -f /proc/bus/usb/devices ] && umount /proc/bus/usb - +#sig= +#retry=3 +#remaining=`awk '!/^#/ && $3 ~ /^rpc_pipefs$/ || $3 ~ /^rpc_svc_gss_pipefs$/ {print $2}' /proc/mounts` +# +#while [ -n "$remaining" -a "$retry" -gt 0 ] +#do +# if [ "$retry" -lt 3 ]; then +# runcmd $"Unmounting pipe file systems (retry): " umount -f $remaining +# else +# runcmd $"Unmounting pipe file systems: " umount -f $remaining +# fi +# sleep 2 +# remaining=`awk '!/^#/ && $3 ~ /^rpc_pipefs$/ || $3 ~ /^rpc_svc_gss_pipefs$/ {print $2}' /proc/mounts` +# [ -z "$remaining" ] && break +# /sbin/fuser -k -m $sig $remaining >/dev/null +# sleep 5 +# retry=$(($retry-1)) +# sig=-9 +#done +# +#sig= +#retry=3 +#remaining=`halt_get_remaining | sort -r` +# +#while [ -n "$remaining" -a "$retry" -gt 0 ] +#do +# if [ "$retry" -lt 3 ]; then +# LANG=C runcmd $"Unmounting file systems (retry): " umount -f $remaining +# else +# LANG=C runcmd $"Unmounting file systems: " umount -f $remaining +# fi +# sleep 2 +# remaining=`halt_get_remaining | sort -r` +# [ -z "$remaining" ] && break +# /sbin/fuser -k -m $sig $remaining >/dev/null +# sleep 5 +# retry=$(($retry-1)) +# sig=-9 +#done +#[ -f /proc/bus/usb/devices ] && umount /proc/bus/usb +# # remove the crash indicator flag rm -f /.autofsck -# Try all file systems other than root and RAM disks, one last time. -mount | awk '!/( \/ |^\/dev\/root|^\/dev\/ram| \/proc )/ { print $3 }' | \ - while read line; do - umount -f $line -done - -# Remount read only anything that's left mounted. -# echo $"Remounting remaining filesystems readonly" -mount | awk '{ print $3 }' | while read line; do - mount -n -o ro,remount $line -done +## Try all file systems other than root and RAM disks, one last time. +#mount | awk '!/( \/ |^\/dev\/root|^\/dev\/ram| \/proc )/ { print $3 }' | \ +# while read line; do +# umount -f $line +#done +# +## Remount read only anything that's left mounted. +## echo $"Remounting remaining filesystems readonly" +#mount | awk '{ print $3 }' | while read line; do +# mount -n -o ro,remount $line +#done # Now halt or reboot. echo $"$message"