From 6eb6971f4d721fc8d648323f0dbd52d0697b2a7b Mon Sep 17 00:00:00 2001 From: Yelninei Date: Tue, 3 Feb 2026 08:30:53 +0000 Subject: services: Add and use shepherd-signal-action. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 Merges: #6097 --- doc/guix.texi | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index b0ab0c1db5b..9924f4771f2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -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. -- cgit v1.3