From debbugs-submit-bounces@debbugs.gnu.org Thu May 11 17:24:18 2017 Received: (at 26830) by debbugs.gnu.org; 11 May 2017 21:24:18 +0000 Received: from localhost ([127.0.0.1]:39212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8vZK-0007Rm-4L for submit@debbugs.gnu.org; Thu, 11 May 2017 17:24:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8vZJ-0007Ra-0a for 26830@debbugs.gnu.org; Thu, 11 May 2017 17:24:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d8vZA-00014b-0K for 26830@debbugs.gnu.org; Thu, 11 May 2017 17:24:11 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8vZ9-00014W-Sm; Thu, 11 May 2017 17:24:07 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:60500 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d8vZ9-0004un-1n; Thu, 11 May 2017 17:24:07 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Mathieu Othacehe Subject: Re: bug#26830: Allow services to implement a 'reload' action References: <87d1bjtlpd.fsf@lassieur.org> <86vapa6nyi.fsf@gmail.com> Date: Thu, 11 May 2017 23:24:04 +0200 In-Reply-To: <86vapa6nyi.fsf@gmail.com> (Mathieu Othacehe's message of "Tue, 09 May 2017 17:37:25 +0200") Message-ID: <87vap7kryj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26830 Cc: 26830@debbugs.gnu.org, =?utf-8?Q?Cl=C3=A9ment?= Lassieur X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hello! Mathieu Othacehe skribis: >> Services do not have to implement 'reload' and if, say, foo-daemon >> doesn't implement it, 'herd reload foo-daemon' will return 1 and display >> a message saying that foo-deamon does not have an action 'reload'. >> That's the reason of the #f default value. >> >> WDYT? > > Your whole serie LGTM for me ! Same here, really happy to see this addressed! > I have just one small concern, there is a already a "reload" action on > shepherd root service. Right, but that=E2=80=99s just for =E2=80=98root=E2=80=99, not for the othe= r services. However, I think =E2=80=98reload=E2=80=99 might be confusing since in fact = it doesn=E2=80=99t load Scheme code, contrary to what =E2=80=9Cherd load root foo.scm=E2=80=9D= does (maybe that=E2=80=99s what you meant?). In fact it=E2=80=99s closer to what =E2= =80=9Cherd restart foo=E2=80=9D does. What about changing the name to =E2=80=98reconfigure=E2=80=99 or =E2=80=98u= pgrade=E2=80=99 to avoid the confusion? The logical next step of this series will be to have the service upgrade code in =E2=80=98guix system reconfigure=E2=80=99 invoke this action when i= t is defined. That will be awesome. Some comments: + #:actions (make-actions + (reload + "Reload the service's configuration file= s." + #$(shepherd-service-reload service))))))= )) Here I think we should only define the action when it has a non-#f value. That way we can distinguish between services that have a useful reload/reconfigure/upgrade action and those that don=E2=80=99t; in the latt= er case, we simply use =E2=80=98restart=E2=80=99 when upgrading. Regarding nginx: + (stop (nginx-action "-s" "stop")) + (reload (nginx-action "-s" "reload")))))))) Is this of any use in practice? The nginx command line is something like: /gnu/store/74kz9m850ycxpzkg6dvn9wbd3xjkwwrb-nginx-1.12.0/sbin/nginx -c /g= nu/store/5w11ahw113fndvab3xmwcjzs2rw56sbh-nginx-config/bayfront.conf -p /va= r/run/nginx and the configuration file in /gnu/store is immutable, so =E2=80=9Cnginx -s reload=E2=80=9D does nothing. If the action took an argument, we could do: herd reconfigure nginx /gnu/store/=E2=80=A6-new-config.conf which would translate to: nginx -s reload -c /gnu/store/=E2=80=A6-new-config.conf Probably our best option. Otherwise, I think we=E2=80=99d have to move the config to a fixed location= , say /etc/nginx, for =E2=80=9Cnginx -s reload=E2=80=9D to have any effect. Howe= ver I don=E2=80=99t quite like the use of /etc. Thoughts? Does Dovecot have the same problem? Thank you! Ludo=E2=80=99.