guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[shepherd] 01/06: service: ‘daemonize’ actions detaches from controlling


From: Ludovic Courtès
Subject: [shepherd] 01/06: service: ‘daemonize’ actions detaches from controlling terminal.
Date: Wed, 27 Nov 2024 17:45:51 -0500 (EST)

civodul pushed a commit to branch main
in repository shepherd.

commit 2b41e5bad65e783c7a9cc4d7a3f460cab6b64285
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Nov 25 22:34:13 2024 +0100

    service: ‘daemonize’ actions detaches from controlling terminal.
    
    Fixes <https://issues.guix.gnu.org/74534>.
    
    * modules/shepherd/service.scm (root-service)[daemonize]: Add call to
    ‘setsid’.
    
    Reported-by: Jelle Licht <jlicht@fsfe.org>
---
 modules/shepherd/service.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 13ca230..71feeeb 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -2801,6 +2801,7 @@ we want to receive these signals."
                (if (zero? (primitive-fork))
                    (begin
                      (catch-system-error (prctl PR_SET_CHILD_SUBREAPER 1))
+                     (setsid)                ;detach from controlling terminal
                      (run-hook %post-daemonize-hook)
                      (local-output (l10n "Now running as process ~a.")
                                    (getpid))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]