diff options
| author | Bill Nottingham <notting@redhat.com> | 2001-09-21 15:58:58 +0000 |
|---|---|---|
| committer | Bill Nottingham <notting@redhat.com> | 2001-09-21 15:58:58 +0000 |
| commit | 8efba0500dd67a6bfe3b0a30a64061cf585dd293 (patch) | |
| tree | 373025715db82c1a3de82efb0b137d0dca6357e7 /rc.d/init.d/netfs | |
| parent | 11f176d4896e418b12da2cb9c9d420390cd16cdc (diff) | |
Backport some fixes from the 7.2 branch:
- unmounting of loopback devices
- unmounting of /initrd
- don't blow up on ext3/reiserfs in /etc/init.d/halt
- module alias determination fixes
- quota tweaks
Diffstat (limited to 'rc.d/init.d/netfs')
| -rwxr-xr-x | rc.d/init.d/netfs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs index 97a46d1b..adea6665 100755 --- a/rc.d/init.d/netfs +++ b/rc.d/init.d/netfs @@ -20,7 +20,7 @@ fi . /etc/sysconfig/network # Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 +[ "${NETWORKING}" = "no" ] && exit 0 NFSFSTAB=`grep -v '^#' /etc/fstab | awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'` SMBFSTAB=`grep -v '^#' /etc/fstab | awk '{ if ($3 ~ /^smbfs$/ && $4 !~ /noauto/) print $2}'` @@ -45,6 +45,7 @@ case "$1" in stop) # 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 @@ -55,7 +56,12 @@ case "$1" in else action $"Unmounting loopback filesystems: " umount $remaining fi + 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 |
