Commit Diff


commit - 3ccd61629b641613bcccbc51125330efab9c89a7
commit + 52b599a63c488d3a80bb9f5dd97bad0b10103c54
blob - f994ffe159da4095a37a661be3f1d6b0bdbd711f
blob + 299290688060cdabf11a8a74800aeb99fb2b98fa
--- src/libthread/daemonize.c
+++ 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");