aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-09-08 18:48:48 +0200
committerLudovic Courtès <ludo@gnu.org>2018-09-08 23:02:00 +0200
commit985975ae80fe5a8e58319b3a5aaf14da940c4419 (patch)
tree631400380ee9d82df6c27db50a2b9c83340dd7f5
parentc665774a1ca9431746b1d559b06e24c1b05625d8 (diff)
downloadguix-985975ae80fe5a8e58319b3a5aaf14da940c4419.tar.gz
guix-985975ae80fe5a8e58319b3a5aaf14da940c4419.zip
services: nginx: Don't read PID file when passed a custom config file.
Fixes <https://bugs.gnu.org/32665>. * gnu/services/web.scm (nginx-shepherd-service): Check whether FILE is true and don't read the PID file if it is; use 'read-pid-file' instead of a potentially endless loop.
-rw-r--r--gnu/services/web.scm14
1 files changed, 6 insertions, 8 deletions
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 3778efd048..1c993b29fe 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -610,14 +610,12 @@ of index files."
(match '#$args
(("-s" . _) #t)
(_
- (let loop ((duration 0))
- ;; https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864/comments/7
- (sleep duration)
- (if (file-exists? #$pid-file)
- (let ((pid (call-with-input-file #$pid-file read)))
- ;; it could be #<eof>
- (if (integer? pid) pid (loop 1)))
- (loop 1)))))))))
+ ;; When FILE is true, we cannot be sure that PID-FILE will
+ ;; be created, so assume it won't show up. When FILE is
+ ;; false, read PID-FILE.
+ #$(if file
+ #~#t
+ #~(read-pid-file #$pid-file))))))))
;; TODO: Add 'reload' action.
(list (shepherd-service