~ruther/guix-local

b377ec079d9ffe8f0f372c43735ad012ea889b6f — Ludovic Courtès 7 months ago 1c23567
services: nginx: Ensure ‘stop’ is synchronous.

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 <maxim@guixotic.coop>
Change-Id: I69e8626aab07f806ddc8b1d09d9f0e052a85cf47
1 files changed, 6 insertions(+), 1 deletions(-)

M gnu/services/web.scm
M gnu/services/web.scm => gnu/services/web.scm +6 -1
@@ 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)