GNU bug report logs - #58405
[PATCH] services: nginx: Add reload action

Previous Next

Package: guix-patches;

Reported by: EuAndreh <eu <at> euandre.org>

Date: Mon, 10 Oct 2022 04:41:02 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Christopher Baines <mail <at> cbaines.net>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#58405: closed ([PATCH] services: nginx: Add reload action)
Date: Thu, 13 Oct 2022 11:40:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 13 Oct 2022 12:38:14 +0100
with message-id <87wn946jh0.fsf <at> cbaines.net>
and subject line Re: [bug#58405] [PATCH] services: nginx: Add reload action
has caused the debbugs.gnu.org bug report #58405,
regarding [PATCH] services: nginx: Add reload action
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
58405: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58405
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: EuAndreh <eu <at> euandre.org>
To: guix-patches <at> gnu.org
Cc: EuAndreh <eu <at> euandre.org>
Subject: [PATCH] services: nginx: Add reload action
Date: Mon, 10 Oct 2022 01:39:32 -0300
In a new "reload" shepherd-action, send a SIGHUP to the NGINX master
process, so that it can re-read the configuration file and start new
worker processes.

* gnu/services/web.scm (nginx-shepherd-service): Add the "reload"
  shepherd-action
---
 gnu/services/web.scm | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index e5ab1a1180..227a577de3 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -807,7 +807,6 @@ (define (nginx-shepherd-service config)
                           #~#t
                           #~(read-pid-file #$pid-file))))))))
 
-     ;; TODO: Add 'reload' action.
      (list (shepherd-service
             (provision '(nginx))
             (documentation "Run the nginx daemon.")
@@ -815,7 +814,19 @@ (define (nginx-shepherd-service config)
             (modules `((ice-9 match)
                        ,@%default-modules))
             (start (nginx-action "-p" run-directory))
-            (stop (nginx-action "-s" "stop")))))))
+            (stop (nginx-action "-s" "stop"))
+            (actions
+              (list
+               (shepherd-action
+                 (name 'reload)
+                 (documentation "Reload NGINX configuration file and restart worker processes.")
+                 (procedure
+                   #~(lambda (pid)
+                       (if pid
+                         (begin
+                           (kill pid SIGHUP)
+                           (format #t "Service NGINX (PID ~a) has been reloaded." pid))
+                         (format #t "Service NGINX is not running."))))))))))))
 
 (define nginx-service-type
   (service-type (name 'nginx)
-- 
2.37.3



[Message part 3 (message/rfc822, inline)]
From: Christopher Baines <mail <at> cbaines.net>
To: EuAndreh <eu <at> euandre.org>
Cc: 58405-done <at> debbugs.gnu.org
Subject: Re: [bug#58405] [PATCH] services: nginx: Add reload action
Date: Thu, 13 Oct 2022 12:38:14 +0100
[Message part 4 (text/plain, inline)]
Christopher Baines <mail <at> cbaines.net> writes:

> I'm not quite sure how to address that, but I think this can still be
> merged.

I've gone ahead and pushed this as
10d429f2fce321d8285684503094694ec3979865.

Thanks,

Chris
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 2 years and 271 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.