> I don't have tun compiled on this Kernel.
> Can this be the cause to have this fail? (returning 1 will cause
> postinst to fail, right?)

Could you please try the attached patch? I'd like to do a new upload
pretty soon.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: [EMAIL PROTECTED]
Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!
--- /etc/init.d/virtualbox-ose	2008-03-05 15:54:46.000000000 +0100
+++ virtualbox-ose	2008-03-10 11:52:01.000000000 +0100
@@ -173,15 +173,6 @@
       fail_msg
       return 1
     fi
-    # Fail if we don't have the kernel tun device
-    # Make sure that the tun module is loaded (Ubuntu 7.10 needs this)
-    modprobe tun > /dev/null 2>&1
-    if ! cat /proc/misc 2>/dev/null | grep tun > /dev/null
-    then
-      fail_msg
-      return 1
-    fi
-    succ_msg
     # Read the configuration file entries line by line and create the
     # interfaces
     while read line
@@ -195,6 +186,21 @@
         if ((! expr match "$2" "#" > /dev/null) &&
             (test -z "$4" || expr match "$4" "#" > /dev/null))
         then
+	  if [ "$module_available" != 1 ]
+	  then
+		# Fail if we don't have the kernel tun device
+		# Make sure that the tun module is loaded (Ubuntu 7.10 needs this)
+		# We only test do once, but we have to do it here, because otherwise an empty
+		# configuration file would trigger the modprobe too.
+		modprobe tun > /dev/null 2>&1
+		if ! cat /proc/misc 2>/dev/null | grep tun > /dev/null
+		then
+			fail_msg
+			return 1
+          	fi
+          	succ_msg
+		module_available=1
+	  fi
           case $user in
             +*)
                 group=`echo $2 | cut -c2-`

Reply via email to