1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 13:10:33 +02:00

services: Add and use shepherd-signal-action.

* gnu/services/shepherd.scm (shepherd-signal-action): New procedure.

* gnu/services/audio.scm (mpd-shepherd-service): Use it for actions.
* gnu/services/base.scm (syslog-shepherd-service):
* gnu/services/base.scm (dnsmasq-shepherd-service):
* gnu/services/file-sharing.scm (transmission-daemon-shepherd-service):
* gnu/services/monitoring.scm (vnstat-shepherd-service):
* gnu/services/mail.scm (rspamd-shepherd-service):

* doc/guix.texi (shepherd-signal-action): Document it.

Change-Id: Ief5e00c7d430ec4aa28c3ef11d0ef9897793b45f
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #6097
This commit is contained in:
Yelninei
2026-02-03 08:30:53 +00:00
committed by Ludovic Courtès
parent 1ec777def8
commit 6eb6971f4d
8 changed files with 77 additions and 81 deletions

View File

@@ -50488,6 +50488,29 @@ cat $(herd configuration tor)
This can come in as a handy debugging tool!
@end deffn
@deffn {Procedure} shepherd-signal-action name signal @
[#:documentation `Send signal @var{signal} to the running service`] @
[#:message `Service has been asked to perform @var{name}`]
Return a shepherd action with @var{name} to send @var{signal} to the
running process. The optional @var{documentation} and @var{message} can be used
to customize the documentation and output message.
Many daemons perform special actions after receiving a specific signal.
For example the @command{syslogd} logger will reread its configuration file
after receiving @code{SIGHUP}.
After adding
@lisp
(shepherd-signal-action 'reload SIGHUP))
@end lisp
the @code{reload} action will be available and can be used with
@example
herd reload syslogd
@end example
@end deffn
@defvar shepherd-root-service-type
The service type for the Shepherd ``root service''---i.e., PID@tie{}1.