diff options
author | Daniel Lezcano <daniel.lezcano@free.fr> | 2011-08-09 16:51:01 +0200 |
---|---|---|
committer | Daniel Lezcano <dlezcano@fr.ibm.com> | 2011-08-09 16:51:01 +0200 |
commit | dff21ef019d001a25adcaa947d67942b61bbab22 (patch) | |
tree | dc3499bc7ecfec16c5f9e1373571035e75e781f5 /src/lxc | |
parent | Use container's /run/utmp if it exists (diff) | |
download | lxc-dff21ef019d001a25adcaa947d67942b61bbab22.tar.gz lxc-dff21ef019d001a25adcaa947d67942b61bbab22.tar.bz2 lxc-dff21ef019d001a25adcaa947d67942b61bbab22.zip |
explicitly do not use the console
If the keyword 'none' is specified for the console name, lxc will ignore creating a console.
That allows to have a rootfs but without a console.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Diffstat (limited to 'src/lxc')
-rw-r--r-- | src/lxc/console.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lxc/console.c b/src/lxc/console.c index b5fc270..73bec78 100644 --- a/src/lxc/console.c +++ b/src/lxc/console.c @@ -176,6 +176,9 @@ int lxc_create_console(struct lxc_conf *conf) return -1; } + if (!strcmp(console->path, "none")) + return 0; + if (openpty(&console->master, &console->slave, console->name, NULL, NULL)) { SYSERROR("failed to allocate a pty"); @@ -300,6 +303,11 @@ int lxc_console_mainloop_add(struct lxc_epoll_descr *descr, return 0; } + if (console->peer == -1) { + INFO("no console will be used"); + return 0; + } + if (lxc_mainloop_add_handler(descr, console->master, console_handler, console)) { ERROR("failed to add to mainloop console handler for '%d'", |