From b377ec079d9ffe8f0f372c43735ad012ea889b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 26 Aug 2025 11:52:25 +0200 Subject: [PATCH] =?UTF-8?q?services:=20nginx:=20Ensure=20=E2=80=98stop?= =?UTF-8?q?=E2=80=99=20is=20synchronous.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes guix/maintenance#17. Fixes a bug whereby ‘nginx -s stop’ might return before the main nginx process has actually stopped, which in turn would lead ‘herd restart nginx’ to hang. * gnu/services/web.scm (nginx-shepherd-service): Change ‘stop’ to use ‘make-kill-destructor’. Reported-by: Maxim Cournoyer Change-Id: I69e8626aab07f806ddc8b1d09d9f0e052a85cf47 --- gnu/services/web.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index d08122353f5..f811497ae1c 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -907,7 +907,12 @@ of index files." (modules `((ice-9 match) ,@%default-modules)) (start (nginx-action "-p" run-directory)) - (stop (nginx-action "-s" "stop")) + + ;; Instead of invoking "nginx -s stop", use + ;; 'make-kill-destructor', which waits for the main process to + ;; actually terminate. + (stop #~(make-kill-destructor)) + (actions (list (shepherd-configuration-action config-file)