From 52e01148b171341e7dc35de12672dd9bd70124d3 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 21 Sep 2001 15:41:15 +0000 Subject: umount /dev/loopX doesn't work; you must use the mount point --- rc.d/init.d/netfs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'rc.d/init.d/netfs') 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 -- cgit v1.2.1