Subject: patch: vdevmap fix for util-vserver 0.30.216-pre2967
From: Corey Wright <undefined@pobox.com>
Date: Sun, 22 May 2011 02:06:52 -0500
Sun, 22 May 2011 02:06:52 -0500
the attached patch is similar to patches i've previously submitted to fix
vdevmap support in util-vserver, but specific to 0.30.216-pre2967.

just yesterday i noted the new version of util-vserver, previously using
0.30.216-pre2955, and tonight tested it, confirmed the vdevmap support is
still broken, applied the attached patch to the source, and created a
properly patched package (evidenced by the debian changelog entry in the
patch).

thanks for util-vserver and the debian source package (ie the "debian"
directory within the source tarball).

corey
--
undefined@pobox.com


diff -urNpd util-vserver-0.30.216-pre2967.orig/debian/changelog util-vserver-0.30.216-pre2967/debian/changelog
--- util-vserver-0.30.216-pre2967.orig/debian/changelog	2011-05-14 16:37:34.000000000
+0000
+++ util-vserver-0.30.216-pre2967/debian/changelog	2011-05-22 05:21:53.000000000 +0000
@@ -1,3 +1,9 @@
+util-vserver (0.30.216-pre2967-2) unstable; urgency=low
+
+  * Fix vdevmap support in vserver.{start,stop}.
+
+ -- Corey Wright <undefined+vserver@pobox.com>  Sun, 22 May 2011 00:18:35 -0500
+
 util-vserver (0.30.216-pre2967-1) unstable; urgency=low
 
   * Initial release
diff -urNpd util-vserver-0.30.216-pre2967.orig/scripts/vserver.start util-vserver-0.30.216-pre2967/scripts/vserver.start
--- util-vserver-0.30.216-pre2967.orig/scripts/vserver.start	2011-05-14 16:36:31.000000000
+0000
+++ util-vserver-0.30.216-pre2967/scripts/vserver.start	2011-05-22 05:17:08.000000000
+0000
@@ -123,8 +123,6 @@ prepareInit      "$VSERVER_DIR"
 addtoCPUSET      "$VSERVER_DIR"
 attachToCgroup   "$VSERVER_DIR"
 
-handleDeviceMap --set "$S_CONTEXT" "$VSERVER_DIR/apps/vdevmap"
-
 pushd "$VSERVER_DIR"/vdir/ >/dev/null
 execScriptlets   "$VSERVER_DIR" "$VSERVER_NAME" pre-start
 popd >/dev/null
@@ -187,6 +185,9 @@ is_executed=1
 "${INITCMD_START_SYNC[@]}"
 popd >/dev/null
 
+getFileValue S_CONTEXT "$VSERVER_DIR/context"
+handleDeviceMap --set "$S_CONTEXT" "$VSERVER_DIR/apps/vdevmap"
+
 pushd "$VSERVER_DIR"/vdir/ >/dev/null
 execScriptlets   "$VSERVER_DIR" "$VSERVER_NAME" post-start
 popd >/dev/null
diff -urNpd util-vserver-0.30.216-pre2967.orig/scripts/vserver.stop util-vserver-0.30.216-pre2967/scripts/vserver.stop
--- util-vserver-0.30.216-pre2967.orig/scripts/vserver.stop	2011-05-14 16:36:31.000000000
+0000
+++ util-vserver-0.30.216-pre2967/scripts/vserver.stop	2011-05-22 05:17:19.000000000
+0000
@@ -68,6 +68,8 @@ cd "$VSERVER_DIR"/vdir/
 execScriptlets     "$VSERVER_DIR" "$VSERVER_NAME" pre-stop
 cd "$VSERVER_DIR"/vdir/
 
+handleDeviceMap --unset "$S_CONTEXT" "$VSERVER_DIR/apps/vdevmap"
+
 test -z "$OPTION_DEFAULTTTY" || setDefaultTTY "$VSERVER_DIR"
 
 $_VATTRIBUTE --set --xid "$S_CONTEXT" --flag !SC_HELPER
@@ -117,8 +119,6 @@ sendKillSequence   "$S_CONTEXT" "${INITK
 
 execScriptlets    "$VSERVER_DIR" "$VSERVER_NAME" post-stop
 
-handleDeviceMap --unset "$S_CONTEXT" "$VSERVER_DIR/apps/vdevmap"
-
 umountVserver     "$VSERVER_DIR" || :
 disableInterfaces "$VSERVER_DIR"