From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7kaw-00055Q-Cf for guix-patches@gnu.org; Mon, 08 May 2017 11:29:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7kas-000509-F6 for guix-patches@gnu.org; Mon, 08 May 2017 11:29:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:36364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d7kas-000505-BU for guix-patches@gnu.org; Mon, 08 May 2017 11:29:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d7kas-000115-7D for guix-patches@gnu.org; Mon, 08 May 2017 11:29:02 -0400 Subject: bug#26830: [PATCH 1/4] services: shepherd: Allow services to implement a 'reload' action. References: <87d1bjtlpd.fsf@lassieur.org> In-Reply-To: <87d1bjtlpd.fsf@lassieur.org> Resent-Message-ID: From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Date: Mon, 8 May 2017 17:28:29 +0200 Message-Id: <20170508152832.4797-1-clement@lassieur.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 26830@debbugs.gnu.org * gnu/services/shepherd.scm ()[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(-) 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