From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2BC9E139695 for ; Sat, 29 Apr 2017 22:56:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5077AE0DBA; Sat, 29 Apr 2017 22:56:11 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2D5C6E0DBA for ; Sat, 29 Apr 2017 22:56:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3FD2F340AC7 for ; Sat, 29 Apr 2017 22:56:10 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 68A117442 for ; Sat, 29 Apr 2017 22:56:08 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1493485455.47cf1d0c707dc88d216bebc15be3f39d5eb47fa9.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/rc/supervise-daemon.c X-VCS-Directories: src/rc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 47cf1d0c707dc88d216bebc15be3f39d5eb47fa9 X-VCS-Branch: master Date: Sat, 29 Apr 2017 22:56:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 839cd294-c20d-4432-a821-e69252b32a46 X-Archives-Hash: ae911b815ac0a47b4422301561e5530d commit: 47cf1d0c707dc88d216bebc15be3f39d5eb47fa9 Author: William Hubbs gmail com> AuthorDate: Sat Apr 29 17:04:15 2017 +0000 Commit: William Hubbs gentoo org> CommitDate: Sat Apr 29 17:04:15 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=47cf1d0c supervise-daemon:remove the controlling tty in the supervisor src/rc/supervise-daemon.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c index b13ec9e8..2a24799c 100644 --- a/src/rc/supervise-daemon.c +++ b/src/rc/supervise-daemon.c @@ -226,6 +226,7 @@ static void child_process(char *exec, char **argv) /* Close any fd's to the passwd database */ endpwent(); + /* remove the controlling tty */ #ifdef TIOCNOTTY ioctl(tty_fd, TIOCNOTTY, 0); close(tty_fd); @@ -696,6 +697,12 @@ int main(int argc, char **argv) rc_service_daemon_set(svcname, exec, (const char * const *) argv, pidfile, true); + /* remove the controlling tty */ +#ifdef TIOCNOTTY + ioctl(tty_fd, TIOCNOTTY, 0); + close(tty_fd); +#endif + /* * Supervisor main loop */