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:
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