[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/07: services: nginx: Add reload action.
From: |
guix-commits |
Subject: |
01/07: services: nginx: Add reload action. |
Date: |
Thu, 13 Oct 2022 07:35:46 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository guix.
commit a9268695e07a1d95a43ea0ea110aafce6cdb5e1a
Author: EuAndreh <eu@euandre.org>
AuthorDate: Mon Oct 10 01:39:32 2022 -0300
services: nginx: Add reload action.
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.
Signed-off-by: Christopher Baines <mail@cbaines.net>
---
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 @@ of index files."
#~#t
#~(read-pid-file #$pid-file))))))))
- ;; TODO: Add 'reload' action.
(list (shepherd-service
(provision '(nginx))
(documentation "Run the nginx daemon.")
@@ -815,7 +814,19 @@ of index files."
(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)
- branch master updated (d8271d8193 -> 10d429f2fc), guix-commits, 2022/10/13
- 01/07: services: nginx: Add reload action.,
guix-commits <=
- 06/07: gnu: micropython: Update to 1.19., guix-commits, 2022/10/13
- 02/07: gnu: libfido2: Install udev rules., guix-commits, 2022/10/13
- 05/07: gnu: cantata: Update to 2.5.0., guix-commits, 2022/10/13
- 04/07: gnu: nheko: Update to 0.10.2., guix-commits, 2022/10/13
- 03/07: gnu: Add go-github-com-savsgio-gotils., guix-commits, 2022/10/13
- 07/07: gnu: entr: Update to 5.2., guix-commits, 2022/10/13