Subject: [bug#46043] [PATCH] Allow booting with custom shepherd package (fixed)

From: Maxime Devos <[email-masked]>
Date: Sat, 23 Jan 2021 16:11:52 +0100

Hi Leo,
On Sat, 2021-01-23 at 09:25 +0100, Leo Prikler wrote:
> Hi Maxime,
> 
> Am Freitag, den 22.01.2021, 20:57 +0100 schrieb Maxime Devos:
> >     (compose concatenate)
> > -   (extend append)
> > +   (extend (lambda (config extra-services)
> > +             (shepherd-configuration
> > +               (inherit config)
> > +               (services (append (shepherd-configuration-services
> > config)
> > +                                 extra-services)))))
> I think you should also patch compose or drop it.  I sadly don't know,
> what impact that would have, but IIUC you should only spawn one
> shepherd-root-service anyway.

Only one shepherd-root-service-type should be spawned, correct.
In practice, this means you'll need to use a construct like this
(if I didn't make any errors):

  (modify-services %base-services
    (shepherd-root-service-type c =>
      (shepherd-configuration
        (inherit c)
        (shepherd a-custom-shepherd))))

For clarification: shepherd services should be added
via the service-extension mechanism, not by
manually changing the 'services' field
(though the latter is a possibility now).

About compose and concatenate: I think it is correct as-is.
If compose is dropped, then shepherd-root-service-type wouldn't be
extensible anymore. I don't see how it could be patched
in a way that makes sense.

Compare with udev-service-type as described in the manual,
which follows the same structure.

Regards,
Maxime
-- 
Maxime Devos <[email-masked]>
PGP Key: C1F3 3EE2 0C52 8FDB 7DD7  011F 49E3 EE22 1917 25EE
Freenode handle: mdevos