[lxc-devel] [PATCH 1/2] usernsexec: don't fail if we can't open pty

Serge Hallyn serge.hallyn at ubuntu.com
Mon Jan 13 02:44:32 UTC 2014


It's nice if we can do it, but not required.  Exiting on this
failure causes lxc-create started by root as a less-privileged
userid to fail.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 src/lxc/lxc_usernsexec.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/lxc/lxc_usernsexec.c b/src/lxc/lxc_usernsexec.c
index f152f91..98a353a 100644
--- a/src/lxc/lxc_usernsexec.c
+++ b/src/lxc/lxc_usernsexec.c
@@ -76,9 +76,8 @@ static void opentty(const char * tty) {
 
 	fd = open(tty, O_RDWR | O_NONBLOCK);
 	if (fd == -1) {
-		printf("FATAL: can't reopen tty: %s", strerror(errno));
-		sleep(1);
-		exit(1);
+		printf("WARN: could not reopen tty: %s", strerror(errno));
+		return;
 	}
 
 	flags = fcntl(fd, F_GETFL);
-- 
1.8.5.2



More information about the lxc-devel mailing list