Subject: Re: [bug#36404] [PATCH 3/3] guix system: Reimplement 'reconfigure'.

From: Ludovic Courtès <[email-masked]>
Date: Sun, 07 Jul 2019 00:20:00 +0200

Hi,

[email-masked] (Jakob L. Kreuze) skribis:

> +(define (%upgrade-shepherd-services os)
>    "Upgrade the Shepherd (PID 1) by unloading obsolete services and loading new
>  services specified in OS and not currently running.
>  
>  This is currently very conservative in that it does not stop or unload any
>  running service.  Unloading or stopping the wrong service ('udev', say) could
>  bring the system down."
> -  (define new-services
> -    (service-value
> -     (fold-services (operating-system-services os)
> -                    #:target-type shepherd-root-service-type)))
> -
> -  ;; Arrange to simply emit a warning if the service upgrade fails.
> -  (with-shepherd-error-handling
> -   (call-with-service-upgrade-info new-services
> -     (lambda (to-restart to-unload)

I think you’d need to include the ‘call-with-service-upgrade-info’ call
in the service-upgrade program that (guix scripts system reconfigure)
produces.  It’s an important part of reconfiguration.

However, ‘call-with-service-upgrade-info’ relies on (guix graph), which
pulls in (guix monads) and many modules that we don’t actually need.

It’s probably just an annoyance more than a real problem, but I think we
should eventually change the (guix graph) API so that it no longer
relies on the ‘%store-monad’, which in turn will make it a better fit in
this context.

Thanks for quickly hacking on this!

Ludo’.