Index: /trunk/packages/invirt-dev/debian/invirt-dev.postinst
===================================================================
--- /trunk/packages/invirt-dev/debian/invirt-dev.postinst	(revision 2629)
+++ /trunk/packages/invirt-dev/debian/invirt-dev.postinst	(revision 2630)
@@ -21,6 +21,4 @@
 	fi
 
-	invirt-build-conf
-            
         cat >>/etc/sudoers <<EOF
 ### BEGIN invirt-dev
@@ -28,4 +26,5 @@
 ### END invirt-dev
 EOF
+
         echo "-----"
         echo "invirt-dev: run"
@@ -45,2 +44,10 @@
     ;;
 esac
+
+if [ -x /etc/init.d/invirt-dev ]; then
+    if hash invoke-rc.d 2>/dev/null; then
+        invoke-rc.d invirt-dev start
+    else
+        /etc/init.d/invirt-dev start
+    fi
+fi
Index: /trunk/packages/invirt-dev/debian/invirt-dev.prerm
===================================================================
--- /trunk/packages/invirt-dev/debian/invirt-dev.prerm	(revision 2629)
+++ /trunk/packages/invirt-dev/debian/invirt-dev.prerm	(revision 2630)
@@ -20,5 +20,5 @@
 case "$1" in
     remove|upgrade|deconfigure)
-        perl -i.bak -ne 's%^### (BEGIN|END) invirt-dev\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers
+        perl -i.bak -ne 's%^### (BEGIN|END) invirt-dev\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers        
     ;;
 
@@ -32,4 +32,12 @@
 esac
 
+if [ -x /etc/init.d/invirt-dev ]; then
+    if hash invoke-rc.d 2>/dev/null; then
+        invoke-rc.d invirt-dev stop
+    else
+        /etc/init.d/invirt-dev stop
+    fi
+fi
+
 # dh_installdeb will replace this with shell code automatically
 # generated by other debhelper scripts.
Index: /trunk/packages/invirt-dev/debian/rules
===================================================================
--- /trunk/packages/invirt-dev/debian/rules	(revision 2629)
+++ /trunk/packages/invirt-dev/debian/rules	(revision 2630)
@@ -2,4 +2,12 @@
 
 DEB_PYTHON_SYSTEM=pysupport
+
+# We use --no-start instead of letting dh_installinit do its thing
+# because, in the postinst, dh_installinit's automatically added code
+# runs before dh_pysupport's automatically added code.
+#
+# This means that when the initscript is started, Python modules
+# installed by the package haven't been fully installed yet.
+DEB_DH_INSTALLINIT_ARGS += --no-start
 
 include /usr/share/cdbs/1/rules/debhelper.mk
