]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
execute: enable console & standard /dev symlinks
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 10 Sep 2017 11:49:18 +0000 (13:49 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 24 Sep 2017 12:10:12 +0000 (14:10 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c
src/lxc/console.c

index 55e3a9e090b9613481a13eea95df3a90f9b7f48c..56d5cc080a1275c18380dc887cc1dcab8de6394d 100644 (file)
@@ -723,7 +723,7 @@ static const struct dev_symlinks dev_symlinks[] = {
        {"/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];
        int ret,i;
@@ -3159,8 +3159,10 @@ int lxc_setup(struct lxc_handler *handler)
                }
        }
 
-       if (!lxc_conf->is_execute && lxc_setup_console(&lxc_conf->rootfs, &lxc_conf->console, lxc_conf->ttydir)) {
-               ERROR("failed to setup the console for '%s'", name);
+       ret = lxc_setup_console(&lxc_conf->rootfs, &lxc_conf->console,
+                               lxc_conf->ttydir);
+       if (ret < 0) {
+               ERROR("Failed to setup console");
                return -1;
        }
 
@@ -3169,8 +3171,9 @@ int lxc_setup(struct lxc_handler *handler)
                        ERROR("failed to setup kmsg for '%s'", name);
        }
 
-       if (!lxc_conf->is_execute && setup_dev_symlinks(&lxc_conf->rootfs)) {
-               ERROR("failed to setup /dev symlinks for '%s'", name);
+       ret = lxc_setup_dev_symlinks(&lxc_conf->rootfs);
+       if (ret < 0) {
+               ERROR("Failed to setup /dev symlinks");
                return -1;
        }
 
index c882b85c6e3f29b5e1b10b4737192796e4d8a22d..c8e545eb43858d292fdec48f51c391c4e201d4d1 100644 (file)
@@ -228,11 +228,6 @@ extern int lxc_console_mainloop_add(struct lxc_epoll_descr *descr,
 {
        struct lxc_console *console = &conf->console;
 
-       if (conf->is_execute) {
-               INFO("no console for lxc-execute.");
-               return 0;
-       }
-
        if (!conf->rootfs.path) {
                INFO("no rootfs, no console.");
                return 0;
@@ -526,11 +521,6 @@ int lxc_console_create(struct lxc_conf *conf)
        struct lxc_console *console = &conf->console;
        int ret;
 
-       if (conf->is_execute) {
-               INFO("not allocating a console device for lxc-execute.");
-               return 0;
-       }
-
        if (!conf->rootfs.path) {
                INFO("container does not have a rootfs, console device will be shared with the host");
                return 0;