From 2603a1f4201668c13f992dbde3dd46be4dc2c31d Mon Sep 17 00:00:00 2001 From: Jelle Licht Date: Sun, 2 Jul 2017 02:58:36 +0200 Subject: [PATCH] Register SIGCHLD handler after primitive-fork. * modules/shepherd.scm (main): Move call to 'sigaction' so daemonized process can handle SIGCHLD signal. --- modules/shepherd.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/shepherd.scm b/modules/shepherd.scm index f7c169d..dfae7d6 100644 --- a/modules/shepherd.scm +++ b/modules/shepherd.scm @@ -142,9 +142,6 @@ ;; Start the 'root' service. (start root-service) - ;; Install the SIGCHLD handler. - (sigaction SIGCHLD respawn-service SA_NOCLDSTOP) - ;; This _must_ succeed. (We could also put the `catch' around ;; `main', but it is often useful to get the backtrace, and ;; `caught-error' does not do this yet.) @@ -164,6 +161,9 @@ (apply format #f (gettext (cadr args)) (caddr args)) (quit 1)))) + ;; Install the SIGCHLD handler. + (sigaction SIGCHLD respawn-service SA_NOCLDSTOP) + (when (provided? 'threads) ;; XXX: This terrible hack allows us to make sure that signal handlers ;; get a chance to run in a timely fashion. Without it, after an EINTR, -- 2.13.2