mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
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.
This commit is contained in:
parent
c665774a1c
commit
985975ae80
1 changed files with 6 additions and 8 deletions
|
@ -610,14 +610,12 @@ (define (nginx-shepherd-service config)
|
||||||
(match '#$args
|
(match '#$args
|
||||||
(("-s" . _) #t)
|
(("-s" . _) #t)
|
||||||
(_
|
(_
|
||||||
(let loop ((duration 0))
|
;; When FILE is true, we cannot be sure that PID-FILE will
|
||||||
;; https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864/comments/7
|
;; be created, so assume it won't show up. When FILE is
|
||||||
(sleep duration)
|
;; false, read PID-FILE.
|
||||||
(if (file-exists? #$pid-file)
|
#$(if file
|
||||||
(let ((pid (call-with-input-file #$pid-file read)))
|
#~#t
|
||||||
;; it could be #<eof>
|
#~(read-pid-file #$pid-file))))))))
|
||||||
(if (integer? pid) pid (loop 1)))
|
|
||||||
(loop 1)))))))))
|
|
||||||
|
|
||||||
;; TODO: Add 'reload' action.
|
;; TODO: Add 'reload' action.
|
||||||
(list (shepherd-service
|
(list (shepherd-service
|
||||||
|
|
Loading…
Reference in a new issue