Subject: bug#77109: [feature] [shepherd] Accept multiple services for actions

From: Tomas Volf <[email-masked]>
Date: Wed, 19 Mar 2025 14:00:12 +0100

Maxim Cournoyer <[email-masked]> 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 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.

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.