]> git.ipfire.org Git - thirdparty/lxc.git/commit
don't set up console for lxc-execute
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 13 Jun 2013 15:06:15 +0000 (10:06 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 13 Jun 2013 17:03:36 +0000 (12:03 -0500)
commit37903589a2de0cbd62f94c5fd06d0aa8d57ca140
treeac3903b04a979dc4934ae462ad26b7bbaae87a5a
parentb515981702133b9aaea1aff378493f054c14d46c
don't set up console for lxc-execute

Currently due to some safety checks for !rootfs.path, lxc-execute works
ok if you do not set lxc.rootfs at all in your lxc.conf. But if you
set lxc.rootfs = '/', then it sets up console, and when you do an
lxc-execute, the console appears hung.

However the lxc.rootfs NULL check was just incidental to not dereference
a NULL pointer.  In fact we should not be setting up a console if the
container isn't running a full-fledged distro with a getty/login
running on the container's /dev/console.

Have lxc_execute() mark in lxc_conf that this is a lxc-execute and not
an lxc-start, and don't set up the console.

The issue is documented at https://sourceforge.net/p/lxc/bugs/67/ .

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
src/lxc/conf.c
src/lxc/conf.h
src/lxc/console.c
src/lxc/execute.c