diff options
author | Bill Nottingham <notting@redhat.com> | 2001-09-21 15:41:15 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2001-09-21 15:41:15 +0000 |
commit | 52e01148b171341e7dc35de12672dd9bd70124d3 (patch) | |
tree | 4f0f14f6f9771c2c375aa5ca6e39f8a1520cccad /rc.d/init.d | |
parent | c9e63689f7192bdb82a088c835783a9de1fe862c (diff) | |
download | initscripts-52e01148b171341e7dc35de12672dd9bd70124d3.tar initscripts-52e01148b171341e7dc35de12672dd9bd70124d3.tar.gz initscripts-52e01148b171341e7dc35de12672dd9bd70124d3.tar.bz2 initscripts-52e01148b171341e7dc35de12672dd9bd70124d3.tar.xz initscripts-52e01148b171341e7dc35de12672dd9bd70124d3.zip |
umount /dev/loopX doesn't work; you must use the mount point
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-x | rc.d/init.d/halt | 6 | ||||
-rwxr-xr-x | rc.d/init.d/netfs | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt index 39e1febd..19e21a28 100755 --- a/rc.d/init.d/halt +++ b/rc.d/init.d/halt @@ -127,7 +127,8 @@ SWAPS=`awk '! /^Filename/ { print $1 }' /proc/swaps` # Unmount file systems, killing processes if we have to. # Unmount loopback stuff first -remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $1}' /proc/mounts` +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 @@ -138,11 +139,12 @@ remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $1}' /proc/moun else runcmd $"Unmounting loopback filesystems: " umount $remaining fi - for dev in $remaining ; do + for dev in $devremaining ; do losetup $dev > /dev/null 2>&1 && \ runcmd $"Detaching loopback device $dev: " losetup -d $device 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 diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs index 4a6a215f..dbd8b58a 100755 --- a/rc.d/init.d/netfs +++ b/rc.d/init.d/netfs @@ -45,7 +45,8 @@ case "$1" in ;; stop) # Unmount loopback stuff first - remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $1}' /proc/mounts` + 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 @@ -56,11 +57,12 @@ case "$1" in else action $"Unmounting loopback filesystems: " umount $remaining fi - for dev in $remaining ; do + for dev in $devremaining ; do losetup $dev >/dev/null 2>&1 && \ action $"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 |