Package: netbase
Version: 4.30
Severity: wishlist
Tags: patch

Hi,

please consider adding the attached patch to /etc/init.d/networking.
With it, the network is not shut down if any network block devices (NBD
or eNBD) are still mounted. The patch updates the list of network file
systems as well.

Cheers, Til
--- /tmp/netbase-4.30/debian/netbase.init       2007-01-06 16:36:08.000000000 
+0100
+++ networking  2007-11-27 02:13:08.532698954 +0100
@@ -83,11 +83,23 @@
        ;;
 
 stop)
-       if sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\2/p' /proc/mounts | 
-               grep -qE '^(nfs[1234]?|smbfs|ncp|ncpfs|coda|cifs)$'; then
-           log_warning_msg "not deconfiguring network interfaces: network 
shares still mounted."
-           exit 0
-       fi
+       exec 9<&0 </proc/mounts
+       while read DEV MTPT FSTYPE REST
+       do
+               case $DEV in
+                       /dev/nbd*|/dev/nd[a-z]*)
+                               log_warning_msg "not deconfiguring network 
interfaces: network devices still mounted."
+                               exit 0
+                               ;;
+               esac
+               case $FSTYPE in
+                       nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2)
+                               log_warning_msg "not deconfiguring network 
interfaces: network file systems still mounted."
+                               exit 0
+                               ;;
+               esac
+       done
+       exec 0<&9 9<&-
 
        log_action_begin_msg "Deconfiguring network interfaces"
        if ifdown -a --exclude=lo; then

Reply via email to