mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
services: nginx: Add 'shepherd-requirement' configuration field.
* gnu/services/web.scm (<nginx-configuration>)[shepherd-requirement]: New field. (nginx-shepherd-service): Honor it. * doc/guix.texi (Web Services): Document it.
This commit is contained in:
parent
61b63e7fa7
commit
8c5065c6d1
2 changed files with 13 additions and 2 deletions
|
@ -28841,6 +28841,14 @@ types, or alternatively, a config file can be provided.
|
|||
@item @code{nginx} (default: @code{nginx})
|
||||
The nginx package to use.
|
||||
|
||||
@item @code{shepherd-requirement} (default: @code{'()})
|
||||
This is a list of symbols naming Shepherd services the nginx service
|
||||
will depend on.
|
||||
|
||||
This is useful if you would like @command{nginx} to be started after a
|
||||
back-end web server or a logging service such as Anonip has been
|
||||
started.
|
||||
|
||||
@item @code{log-directory} (default: @code{"/var/log/nginx"})
|
||||
The directory to which NGinx will write log files.
|
||||
|
||||
|
|
|
@ -93,6 +93,7 @@ (define-module (gnu services web)
|
|||
nginx-configuration
|
||||
nginx-configuration?
|
||||
nginx-configuration-nginx
|
||||
nginx-configuration-shepherd-requirement
|
||||
nginx-configuration-log-directory
|
||||
nginx-configuration-run-directory
|
||||
nginx-configuration-server-blocks
|
||||
|
@ -556,6 +557,8 @@ (define-record-type* <nginx-configuration>
|
|||
nginx-configuration?
|
||||
(nginx nginx-configuration-nginx ;file-like
|
||||
(default nginx))
|
||||
(shepherd-requirement nginx-configuration-shepherd-requirement
|
||||
(default '())) ;list of symbols
|
||||
(log-directory nginx-configuration-log-directory ;string
|
||||
(default "/var/log/nginx"))
|
||||
(run-directory nginx-configuration-run-directory ;string
|
||||
|
@ -779,7 +782,7 @@ (define (nginx-activation config)
|
|||
(define (nginx-shepherd-service config)
|
||||
(match-record config
|
||||
<nginx-configuration>
|
||||
(nginx file run-directory)
|
||||
(nginx file run-directory shepherd-requirement)
|
||||
(let* ((nginx-binary (file-append nginx "/sbin/nginx"))
|
||||
(pid-file (in-vicinity run-directory "pid"))
|
||||
(nginx-action
|
||||
|
@ -803,7 +806,7 @@ (define (nginx-shepherd-service config)
|
|||
(list (shepherd-service
|
||||
(provision '(nginx))
|
||||
(documentation "Run the nginx daemon.")
|
||||
(requirement '(user-processes loopback))
|
||||
(requirement `(user-processes loopback ,@shepherd-requirement))
|
||||
(modules `((ice-9 match)
|
||||
,@%default-modules))
|
||||
(start (nginx-action "-p" run-directory))
|
||||
|
|
Loading…
Reference in a new issue