Re: [vserver] patch for vdevmap in vserver.{start,stop}

From: Corey Wright <undefined_at_pobox.com>
Date: Sat 21 May 2011 - 09:20:17 BST
Message-Id: <20110521032017.595a7323.undefined@pobox.com>

On Mon, 20 Sep 2010 03:05:36 -0500
Corey Wright <undefined@pobox.com> wrote:

> the attached patches fix the following problems observed in debian's
> util-vserver 0.30.216-pre2864-2 (from squeeze, but backported to lenny for
> use with linux 2.6.32.21-vs2.3.0.36.29.6), but verified against svn trunk:

the attached patches are still applicable to 0.30.216-pre2955, as i
personally experienced tonight, and presumably to svn trunk as the vserver.
{start,stop} scripts are unchanged.

> 1. vserver.start silently fails setting up vdevmap because S_CONTEXT is not
> defined (and function handleDeviceMap returns 0 after 'test -n "$xid"'
> fails early on).
>
> 2. vserver.start would loudly fail (ie "vc_set_mapping(): No such process")
> if S_CONTEXT was defined because the context doesn't exist yet.
>
> 3. vserver.stop fails unsetting vdevmap and complains (ie "vc_unset_mapping
> (): No such process") because the context no longer exists by the time
> function handleDeviceMap is called.
>
> i might have moved the call to handleDeviceMap later than necessary in
> vserver.start and earlier than necessary in vserver.stop, but it works for
> me, though i don't know where you would put the call if you need init
> scripts within the guest to call mknod (because i don't call
> handleDeviceMap until after init scripts have executed).
>
> the code to set S_CONTEXT was based on how N_CONTEXT is set in function
> _generateIntefaceOptions in vserver.functions, though i could have done
> something more straightforward like how ctx is set in
> _generateChcontextOptions (ie 'read ctx <"$vdir"/context'), but i like the
> elegance of a call to getFileValue.
>
> thanks for util-vserver!
>
> corey
> --
> undefined@pobox.com

Received on Sat May 21 09:20:36 2011
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Sat 21 May 2011 - 09:20:37 BST by hypermail 2.1.8