aboutsummaryrefslogtreecommitdiff
path: root/src/libthread/daemonize.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libthread/daemonize.c')
-rw-r--r--src/libthread/daemonize.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libthread/daemonize.c b/src/libthread/daemonize.c
index f994ffe1..29929068 100644
--- a/src/libthread/daemonize.c
+++ b/src/libthread/daemonize.c
@@ -101,6 +101,13 @@ _threadsetupdaemonize(void)
sigpid = 1;
+ /*
+ * We've been told this program is likely to background itself.
+ * Put it in its own process group so that we don't get a SIGHUP
+ * when the parent exits.
+ */
+ setpgrp();
+
if(pipe(p) < 0)
sysfatal("passer pipe: %r");