From 0cf42eddd2a49c37f8b0e930344fe8724c95073e Mon Sep 17 00:00:00 2001 From: Jonathan Calmels 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 --- 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); -- 2.47.2