From: Jonathan Calmels Date: Tue, 21 Nov 2017 01:30:45 +0000 (-0800) Subject: lxc_init: set the control terminal in the child session X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=46047d1f29a8fb2e433676c78f6eedae5b38df30;p=thirdparty%2Flxc.git lxc_init: set the control terminal in the child session Signed-off-by: Jonathan Calmels --- diff --git a/src/lxc/tools/lxc_init.c b/src/lxc/tools/lxc_init.c index 3aab2397e..c8a5e35b0 100644 --- a/src/lxc/tools/lxc_init.c +++ b/src/lxc/tools/lxc_init.c @@ -193,7 +193,10 @@ int main(int argc, char *argv[]) if (sid < 0) DEBUG("Failed to make child session leader"); - NOTICE("About to exec '%s'", aargv[0]); + if (ioctl(STDIN_FILENO, TIOCSCTTY, 0) < 0) + DEBUG("Failed to set controlling terminal"); + + NOTICE("Exec'ing \"%s\"", aargv[0]); ret = execvp(aargv[0], aargv); ERROR("Failed to exec: '%s' : %s", aargv[0], strerror(errno));