[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 02/06: shepherd: Spawn signal-handling fiber early on.
From: |
Ludovic Courtès |
Subject: |
[shepherd] 02/06: shepherd: Spawn signal-handling fiber early on. |
Date: |
Mon, 12 Jun 2023 09:39:21 -0400 (EDT) |
civodul pushed a commit to branch master
in repository shepherd.
commit 2b310bd3b0ba0d7a08c77b456d34369cd6444edb
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Jun 11 10:36:47 2023 +0200
shepherd: Spawn signal-handling fiber early on.
* modules/shepherd.scm (run-daemon): Spawn 'signal-handler' fiber before
listening for connections.
---
modules/shepherd.scm | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/shepherd.scm b/modules/shepherd.scm
index 6bd30ca..d2e5f39 100644
--- a/modules/shepherd.scm
+++ b/modules/shepherd.scm
@@ -181,6 +181,10 @@ already ~a threads running, disabling 'signalfd' support")
;; mark them all as FD_CLOEXEC so child processes do not inherit them.
(mark-as-close-on-exec)
+ ;; Spawn a signal handling fiber.
+ (spawn-fiber
+ (essential-task-thunk 'signal-handler signal-handler))
+
;; 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.)
@@ -212,10 +216,6 @@ already ~a threads running, disabling 'signalfd' support")
(#t (display (getpid)))
(_ #t))
- ;; Spawn a signal handling fiber.
- (spawn-fiber
- (essential-task-thunk 'signal-handler signal-handler))
-
;; Enter some sort of a REPL for commands.
(let next-command ()
(match (accept sock (logior SOCK_NONBLOCK SOCK_CLOEXEC))
- [shepherd] branch master updated (0703196 -> 24c9640), Ludovic Courtès, 2023/06/12
- [shepherd] 04/06: comm: 'open-server-socket' deletes the file before binding., Ludovic Courtès, 2023/06/12
- [shepherd] 02/06: shepherd: Spawn signal-handling fiber early on.,
Ludovic Courtès <=
- [shepherd] 01/06: service: 'service' errors out when 'provision' is invalid., Ludovic Courtès, 2023/06/12
- [shepherd] 03/06: shepherd: Simplify 'call-with-server-socket'., Ludovic Courtès, 2023/06/12
- [shepherd] 05/06: service: Add 'respawn-limit' slot to <service>., Ludovic Courtès, 2023/06/12
- [shepherd] 06/06: shepherd: Load config asynchronously and gracefully handle errors., Ludovic Courtès, 2023/06/12