[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 03/06: service: Improve handling of the no-PR_SET_CHILD_SUBRE
From: |
Ludovic Courtès |
Subject: |
[shepherd] 03/06: service: Improve handling of the no-PR_SET_CHILD_SUBREAPER case. |
Date: |
Mon, 1 Jan 2024 17:38:52 -0500 (EST) |
civodul pushed a commit to branch main
in repository shepherd.
commit 839823eb61c6206bc6bc3a5dbad31b8d2eddb334
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Jan 1 17:55:00 2024 +0100
service: Improve handling of the no-PR_SET_CHILD_SUBREAPER case.
This is used on GNU/Hurd when not running as PID 1.
* modules/shepherd/service.scm (check-for-dead-services): Send a message
to the process monitor instead of calling ‘respawn-service’.
---
modules/shepherd/service.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 24224c0..7130f37 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -2767,7 +2767,14 @@ where prctl/PR_SET_CHILD_SUBREAPER is unsupported."
(not (process-exists? running)))
(local-output (l10n "PID ~a (~a) is dead!")
running (service-canonical-name
service))
- (respawn-service service))))))
+
+ ;; Tell the process monitor, which in turn will
+ ;; forward it to the service. The status is
+ ;; unknown, since we could not call 'waitpid' on it,
+ ;; so provide an arbitrary value. Terrible.
+ (put-message (current-process-monitor)
+ `(handle-process-termination
+ ,running ,(ash 77 8))))))))
(define %post-daemonize-hook
;; Hook invoked after the 'daemonize' action in the child process.
- [shepherd] branch main updated (07006e4 -> 520094a), Ludovic Courtès, 2024/01/01
- [shepherd] 02/06: tests: Deal with ‘setrlimit’ behavior on GNU/Hurd., Ludovic Courtès, 2024/01/01
- [shepherd] 01/06: tests: Check whether /proc/*/fd exists before relying on it., Ludovic Courtès, 2024/01/01
- [shepherd] 06/06: support: Update copyright year in ‘--version’ output., Ludovic Courtès, 2024/01/01
- [shepherd] 04/06: service: No SO_REUSEADDR for AF_UNIX sockets., Ludovic Courtès, 2024/01/01
- [shepherd] 03/06: service: Improve handling of the no-PR_SET_CHILD_SUBREAPER case.,
Ludovic Courtès <=
- [shepherd] 05/06: service: inetd: Clear O_NONBLOCK on the connection socket., Ludovic Courtès, 2024/01/01