GNU bug report logs - #77109
[feature] [shepherd] Accept multiple services for actions

Previous Next

Package: guix;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Wed, 19 Mar 2025 06:04:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Tomas Volf <~@wolfsden.cz>
Cc: 77109 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>
Subject: bug#77109: [feature] [shepherd] Accept multiple services for actions
Date: Thu, 20 Mar 2025 12:16:56 +0900
Hi Tomas,

Tomas Volf <~@wolfsden.cz> writes:

> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:
>
>> Hi,
>>
>> Coming from a world where 'guix install package1 package2 ...' is a thing, I
>> sometimes would like to be able to do:
>>
>> herd restart service1 service2 ...
>>
>> Which Shepherd gladly accepts but disregarding service2 ...
>>
>> Would it be a good idea to teach the Shepherd how to do this?
>
> I guess it could be special-cased for start, stop, restart, since these
> three do not take (by default) any arguments (I *think* you can make
> `start' procedure taking arguments?  I have never tried.).  But for
> general case, the `service2' is passed as an argument to the action
> `restart' of service `service1'.

I think even special cased, it wouldn't be too surprising.  I've never
had a though of overriding the base actions for these to extend them in
what would be surprising ways ;-).

> I am not sure having different semantics for restart and any other
> action is a good idea though.
>
> But what I think would be a good idea is for start, stop, restart to
> signal an error when additional unexpected arguments are provided.

Failing to change the behavior as suggested, that would still be an
improvement, yes.  But then you'd also be special casing these actions,
as actions are designed to receive an arbitrary number of arguments and
cannot forcibly know which ones are really used/necessary in advance?

-- 
Thanks,
Maxim




This bug report was last modified 82 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.