Subject: Re: [vserver] util-vserver a basic debian package for most recent version of daniel's wonderfull tools
From: Corey Wright <undefined@pobox.com>
Date: Wed, 16 Sep 2009 00:59:55 -0500
Wed, 16 Sep 2009 00:59:55 -0500
On Tue, 15 Sep 2009 14:57:03 +0200
ADNET Ghislain <gadnet@aqueos.com> wrote:

>   Since we do not have a package for the latest tools and that the 
> debian package for the stable branch of the tools are a modified version 
> (or older i have no historic point of view here) that cannot use cgroups 
> and all the new cool stuff (as far as i was able to make it work with 
> it). I created my firts debian package of util-vserver with the latest 
> daniel's source found.

for debian stable ("lenny"/5.0) util-vserver 0.30.216~r2772-6 worked for my
particular use-case until i enabled cgroup cpu scheduling, and then the
only thing that broke was executing a command in a guest by way of
util-vserver (instead of using a service started directly/indirectly by
"vserver ${GUEST} start") didn't add the new process to the guest's group.
the attached patch fixes that problem and is a smaller change than
upgrading util-vserver.  this mirrors debian's policy of only applying
minimal patches to fix packages in a stable release instead of introducing
a whole new version (and potentially more/different bugs).

the patch is really only one line, but i'm a dot-the-i-and-cross-the-t kind
of guy, so i had to make the surrounding indentation uniform.

my use-case is:
 * 2.6.27.y kernel
 * vs2.3.0.36.6 patch
 * debian lenny host
 * debian lenny & etch guests
 * vhashify
 * cgroup cpu scheduling
 * no disk quotas (yet)

while investigating a failure testfs.sh was reporting, i did build a recent
version of util-vserver and it appeared to work fine in my testing of
testfs.sh (however limited), but i didn't use it beyond that because the
version of util-vserver in stable works for me (and has for the last 6
months with the exception of my one-line patch).

corey
-- 
undefined@pobox.com


--- /usr/lib/util-vserver/vserver.suexec.orig	2008-12-12 22:56:25.000000000 -0600
+++ /usr/lib/util-vserver/vserver.suexec	2009-08-20 02:11:42.000000000 -0500
@@ -22,7 +22,8 @@ test -z "$is_stopped" -o "$OPTION_INSECU
     exit 1
 }
 generateOptions  "$VSERVER_DIR"
-addtoCPUSET  "$VSERVER_DIR"
+addtoCPUSET      "$VSERVER_DIR"
+attachToCgroup   "$VSERVER_DIR"
 
 user=$1
 shift