execute: enable console & standard /dev symlinks

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2017-09-10 13:49:18 +02:00
parent 3b13691dca
commit ed8704d040
No known key found for this signature in database
GPG Key ID: 7B3C391EFEA93624
2 changed files with 8 additions and 15 deletions

View File

@ -782,7 +782,7 @@ static const struct dev_symlinks dev_symlinks[] = {
{"/proc/self/fd/2", "stderr"}, {"/proc/self/fd/2", "stderr"},
}; };
static int setup_dev_symlinks(const struct lxc_rootfs *rootfs) static int lxc_setup_dev_symlinks(const struct lxc_rootfs *rootfs)
{ {
char path[MAXPATHLEN]; char path[MAXPATHLEN];
int ret,i; int ret,i;
@ -3220,13 +3220,16 @@ int lxc_setup(struct lxc_handler *handler)
} }
} }
if (!lxc_conf->is_execute && lxc_setup_console(&lxc_conf->rootfs, &lxc_conf->console, lxc_conf->ttydir)) { ret = lxc_setup_console(&lxc_conf->rootfs, &lxc_conf->console,
ERROR("failed to setup the console for '%s'", name); lxc_conf->ttydir);
if (ret < 0) {
ERROR("Failed to setup console");
return -1; return -1;
} }
if (!lxc_conf->is_execute && setup_dev_symlinks(&lxc_conf->rootfs)) { ret = lxc_setup_dev_symlinks(&lxc_conf->rootfs);
ERROR("failed to setup /dev symlinks for '%s'", name); if (ret < 0) {
ERROR("Failed to setup /dev symlinks");
return -1; return -1;
} }

View File

@ -228,11 +228,6 @@ extern int lxc_console_mainloop_add(struct lxc_epoll_descr *descr,
{ {
struct lxc_console *console = &conf->console; struct lxc_console *console = &conf->console;
if (conf->is_execute) {
INFO("no console for lxc-execute.");
return 0;
}
if (!conf->rootfs.path) { if (!conf->rootfs.path) {
INFO("no rootfs, no console."); INFO("no rootfs, no console.");
return 0; return 0;
@ -526,11 +521,6 @@ int lxc_console_create(struct lxc_conf *conf)
struct lxc_console *console = &conf->console; struct lxc_console *console = &conf->console;
int ret; int ret;
if (conf->is_execute) {
INFO("not allocating a console device for lxc-execute.");
return 0;
}
if (!conf->rootfs.path) { if (!conf->rootfs.path) {
INFO("container does not have a rootfs, console device will be shared with the host"); INFO("container does not have a rootfs, console device will be shared with the host");
return 0; return 0;