#include <unistd.h>
#include <fcntl.h>
#include <pwd.h>
+#ifdef __linux__
+#include <sys/prctl.h>
+#endif
#include "dasynq.h"
#include "service.h"
if (onefd > 2) close(onefd);
if (twofd > 2) close(twofd);
}
-
+
+#ifdef __linux__
+ prctl(PR_SET_CHILD_SUBREAPER, 1);
+#endif
+
/* Set up signal handlers etc */
/* SIG_CHILD is ignored by default: good */
sigset_t sigwait_set;
sigaddset(&sigwait_set, SIGTERM);
if (am_system_init) sigaddset(&sigwait_set, SIGQUIT);
sigprocmask(SIG_BLOCK, &sigwait_set, NULL);
-
+
// Terminal access control signals - we block these so that dinit can't be
// suspended if it writes to the terminal after some other process has claimed
// ownership of it.