[lxc-devel] [lxc/master] lxc_init: set the control terminal in the child session

3XX0 on Github lxc-bot at linuxcontainers.org
Tue Nov 21 01:36:09 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 455 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20171121/339684cd/attachment.bin>
-------------- next part --------------
From 0cf42eddd2a49c37f8b0e930344fe8724c95073e Mon Sep 17 00:00:00 2001
From: Jonathan Calmels <jcalmels at nvidia.com>
Date: Mon, 20 Nov 2017 17:30:45 -0800
Subject: [PATCH] lxc_init: set the control terminal in the child session

Signed-off-by: Jonathan Calmels <jcalmels at nvidia.com>
---
 src/lxc/tools/lxc_init.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lxc/tools/lxc_init.c b/src/lxc/tools/lxc_init.c
index 56cc7e084..82935a381 100644
--- a/src/lxc/tools/lxc_init.c
+++ b/src/lxc/tools/lxc_init.c
@@ -201,6 +201,9 @@ int main(int argc, char *argv[])
 		if (sid < 0)
 			DEBUG("Failed to make child session leader");
 
+                if (ioctl(STDIN_FILENO, TIOCSCTTY, 0) < 0)
+                        DEBUG("Failed to set controlling terminal");
+
 		NOTICE("Exec'ing \"%s\"", my_args.argv[0]);
 
 		ret = execvp(my_args.argv[0], my_args.argv);


More information about the lxc-devel mailing list