From 5332bb844a521401cf465cc8a2c8b52c7b9af82a Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Wed, 19 May 2010 22:15:28 +0200 Subject: [PATCH] Don't close fd 0, fd 1 That breaks the reboot because when we reexec, fd 0 and fd 1 will be closed and these one are created by lxc, not inherited. Signed-off-by: Daniel Lezcano --- src/lxc/conf.c | 3 +++ src/lxc/start.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index a0c7a7c4a..e7c93c0ed 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1373,6 +1373,9 @@ int lxc_create_tty(const char *name, struct lxc_conf *conf) return -1; } + DEBUG("allocated pty '%s' (%d/%d)", + pty_info->name, pty_info->master, pty_info->slave); + /* Prevent leaking the file descriptors to the container */ fcntl(pty_info->master, F_SETFD, FD_CLOEXEC); fcntl(pty_info->slave, F_SETFD, FD_CLOEXEC); diff --git a/src/lxc/start.c b/src/lxc/start.c index b3a8bb4bb..5924c1436 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -600,10 +600,6 @@ int lxc_start(const char *name, char *const argv[], struct lxc_conf *conf) goto out_fini; } - /* no need of other inherited fds but stderr */ - close(fileno(stdin)); - close(fileno(stdout)); - err = lxc_poll(name, handler); if (err) { ERROR("mainloop exited with an error"); -- 2.47.3