diff options
author | Bill Nottingham <notting@redhat.com> | 2001-04-02 19:35:26 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2001-04-02 19:35:26 +0000 |
commit | c8862fff29c3c0cc7d72bac6fb97708731a62554 (patch) | |
tree | 33e6aa249ed46a78c9dba8a2cb0effeed9a1fbeb | |
parent | 1f46c04c0ea19e358f64f0d137e69811de915232 (diff) | |
download | initscripts-c8862fff29c3c0cc7d72bac6fb97708731a62554.tar initscripts-c8862fff29c3c0cc7d72bac6fb97708731a62554.tar.gz initscripts-c8862fff29c3c0cc7d72bac6fb97708731a62554.tar.bz2 initscripts-c8862fff29c3c0cc7d72bac6fb97708731a62554.tar.xz initscripts-c8862fff29c3c0cc7d72bac6fb97708731a62554.zip |
unmount loopback stuff before stopping netfs or shutting down
don't exclude proc when you're doing mount -a -t nonfs...
-rwxr-xr-x | rc.d/init.d/netfs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs index 21358a35..fb182401 100755 --- a/rc.d/init.d/netfs +++ b/rc.d/init.d/netfs @@ -40,9 +40,29 @@ case "$1" in [ -n "$SMBFSTAB" ] && action "Mounting SMB filesystems: " mount -a -t smbfs [ -n "$NCPFSTAB" ] && action "Mounting NCP filesystems: " mount -a -t ncpfs touch /var/lock/subsys/netfs - action "Mounting other filesystems: " mount -a -t noproc,nfs,smbfs,ncpfs + action "Mounting other filesystems: " mount -a -t nonfs,smbfs,ncpfs ;; stop) + # Unmount loopback stuff first + remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts` + [ -n "$remaining" ] && { + sig= + retry=3 + while [ -n "$remaining" -a "$retry" -gt 0 ] + do + if [ "$retry" -lt 3 ]; then + action "Unmounting loopback filesystems (retry):" umount $remaining + else + action "Unmounting loopback filesystems: " umount $remaining + fi + remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts` + [ -z "$remaining" ] && break + /sbin/fuser -k -m $sig $remaining >/dev/null + sleep 5 + retry=$(($retry -1)) + sig=-9 + done + } [ -n "$NFSMTAB" ] && { sig= retry=3 |