From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d96Ol-0002wR-Mu for guix-patches@gnu.org; Fri, 12 May 2017 04:58:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d96Og-0006Zv-R9 for guix-patches@gnu.org; Fri, 12 May 2017 04:58:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:37034) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d96Og-0006Zr-Nb for guix-patches@gnu.org; Fri, 12 May 2017 04:58:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d96Og-00017c-Hp for guix-patches@gnu.org; Fri, 12 May 2017 04:58:02 -0400 Subject: bug#26830: Allow services to implement a 'reload' action Resent-Message-ID: References: <87d1bjtlpd.fsf@lassieur.org> <86vapa6nyi.fsf@gmail.com> <87vap7kryj.fsf@gnu.org> <874lwrq9em.fsf@lassieur.org> <87inl6trbu.fsf@gnu.org> From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur In-reply-to: <87inl6trbu.fsf@gnu.org> Date: Fri, 12 May 2017 10:57:47 +0200 Message-ID: <871sruqwok.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 26830@debbugs.gnu.org Ludovic Courtès writes: > Heya, > > Clément Lassieur skribis: > >> Ludovic Courtès writes: > > [...] > >>> However, I think ‘reload’ might be confusing since in fact it doesn’t >>> load Scheme code, contrary to what “herd load root foo.scm” does (maybe >>> that’s what you meant?). In fact it’s closer to what “herd restart >>> foo” does. >>> >>> What about changing the name to ‘reconfigure’ or ‘upgrade’ to avoid the >>> confusion? >> >> I think it's going to be even more confusing because the other init >> systems (systemd, sysvinit) all call it 'reload'. And, well, people are >> probably more familiar with Systemd's 'reload' than with Shepherd's >> 'reload root' :) WDYT? > > I think it’s a valid argument! However, if the choice is between > internal consistency (on the use of the word “load” in Shepherd > commands) and the rule of least surprise (choosing command names similar > to those of other programs), I would favor internal consistency, I > think. WDYT? Ok! I like 'upgrade'. >>> If the action took an argument, we could do: >>> >>> herd reconfigure nginx /gnu/store/…-new-config.conf >>> >>> which would translate to: >>> >>> nginx -s reload -c /gnu/store/…-new-config.conf >>> >>> Probably our best option. >> >> I don't see the point. If the service has already been reloaded by the >> 'guix system reconfigure' command (let's assume it does, but I know it >> doesn't currently reload nor restart sevices...), why would a user want >> to reload it again with the 'herd' command? Or maybe you want this >> feature as a workaround while the 'guix system reconfigure' that reloads >> services isn't implemented? > > Sorry, I wasn’t clear. Action can take arguments; most don’t, but some > do (like ‘herd start cow-store /mnt’ when installing GuixSD.) What I’m > suggesting here is to add one/several arguments to this reload/upgrade > action. The meaning of these arguments would be defined by the service > itself. > > For nginx, there could be one argument (the config file) or two (the > config file and the nginx executable file name). The reload/upgrade > action would do “nginx -s reload -c …” and so on. > > The ‘upgrade-shepherd-services’ procedure would automatically call the > reload/upgrade action with the right arguments. For that, it needs to > know what the arguments are. An option would be to add an > ‘upgrade-arguments’ field to that would return the > arguments to pass to the upgrade action. > > Does that make sense? Yes! Thank you :)