[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))
- [shepherd] branch main updated (ff93d09 -> b878b82), Ludovic Courtès, 2024/11/27
- [shepherd] 06/06: doc: Document ‘timer-service’ under “Service Collection”., Ludovic Courtès, 2024/11/27
- [shepherd] 01/06: service: ‘daemonize’ actions detaches from controlling terminal.,
Ludovic Courtès <=
- [shepherd] 03/06: service: ‘fork+exec-command’ child process exits upon exception., Ludovic Courtès, 2024/11/27
- [shepherd] 02/06: support: Add ‘exception-with-kind-and-args?’., Ludovic Courtès, 2024/11/27
- [shepherd] 05/06: Add (shepherd service transient)., Ludovic Courtès, 2024/11/27
- [shepherd] 04/06: herd: Add ‘--user’, ‘--working-directory’, etc. use them for ‘timer’., Ludovic Courtès, 2024/11/27