* gnu/services/shepherd.scm (<shepherd-service>)[reload]: Add it.
(shepherd-service-file): Add it to the Shepherd's service definition.
* doc/guix.texi (Services): Update accordingly.
---
doc/guix.texi | 7 ++++---
gnu/services/shepherd.scm | 9 ++++++++-
2 files changed, 12 insertions(+), 4 deletions(-)
Toggle diff (54 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 4446909ed..3ccfa8d9e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8671,9 +8671,10 @@ service:
Run libc's name service cache daemon (nscd).
@end example
-The @command{start}, @command{stop}, and @command{restart} sub-commands
-have the effect you would expect. For instance, the commands below stop
-the nscd service and restart the Xorg display server:
+The @command{start}, @command{stop}, @command{restart} and
+@command{reload} sub-commands have the effect you would expect. For
+instance, the commands below stop the nscd service and restart the Xorg
+display server:
@example
# herd stop nscd
diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index 7281746ab..17e53f774 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -47,6 +47,7 @@
shepherd-service-respawn?
shepherd-service-start
shepherd-service-stop
+ shepherd-service-reload
shepherd-service-auto-start?
shepherd-service-modules
@@ -137,6 +138,8 @@ for a service that extends SHEPHERD-ROOT-SERVICE-TYPE and nothing else."
(start shepherd-service-start) ;g-expression (procedure)
(stop shepherd-service-stop ;g-expression (procedure)
(default #~(const #f)))
+ (reload shepherd-service-reload ;g-expression (procedure)
+ (default #f))
(auto-start? shepherd-service-auto-start? ;Boolean
(default #t))
(modules shepherd-service-modules ;list of module names
@@ -214,7 +217,11 @@ stored."
#:requires '#$(shepherd-service-requirement service)
#:respawn? '#$(shepherd-service-respawn? service)
#:start #$(shepherd-service-start service)
- #:stop #$(shepherd-service-stop service))))))
+ #:stop #$(shepherd-service-stop service)
+ #:actions (make-actions
+ (reload
+ "Reload the service's configuration files."
+ #$(shepherd-service-reload service))))))))
(define (shepherd-configuration-file services)
"Return the shepherd configuration file for SERVICES."
--
2.12.2