diff --git a/src/lxc/attach.c b/src/lxc/attach.c index faa90fcb9..69dafd4bf 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -985,7 +985,7 @@ static int attach_child_main(void* data) new_gid = options->gid; /* setup the control tty */ - if (options->stdin_fd) { + if (options->stdin_fd && isatty(options->stdin_fd)) { if (setsid() < 0) { SYSERROR("unable to setsid"); shutdown(ipc_socket, SHUT_RDWR);