aboutsummaryrefslogtreecommitdiff
path: root/src/rc
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2017-04-29 12:04:15 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2017-04-29 12:04:15 -0500
commit47cf1d0c707dc88d216bebc15be3f39d5eb47fa9 (patch)
treeaa84b3953b8b5770083be9edcea337d62a94f010 /src/rc
parent06a6a27e441372164872c7712b80728527a6ec05 (diff)
supervise-daemon:remove the controlling tty in the supervisor
Diffstat (limited to 'src/rc')
-rw-r--r--src/rc/supervise-daemon.c7
1 files changed, 7 insertions, 0 deletions
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
*/