Subject: Re: bug#63921: Activation snippets in reverse order, prevent boot

From: "pelzflorian (Florian Pelz)" <[email-masked]>
Date: Wed, 07 Jun 2023 10:57:18 +0200

Hi Ludo, hi all.

Ludovic Courtès <[email-masked]> writes:
> I ended up
> rewriting ‘modify-services’.  Good news is we now have tests for this.

In the rewrite, you wrote:
> +(define (apply-clauses clauses services)
> +  "Apply CLAUSES, an alist as returned by 'clause-alist', to SERVICES, a list
> +of services.  Use each clause at most once; raise an error if a clause was not
> +used."

Using clauses at most once broke the greetd example in the manual:
> (append
>  (modify-services %base-services
>    ;; greetd-service-type provides "greetd" PAM service
>    (delete login-service-type)
>    ;; and can be used in place of mingetty-service-type
>    (delete mingetty-service-type))
>  (list
>   (service greetd-service-type

But there are multiple instances of mingetty-service-type in
%base-services.  Now an error is raised on reconfigure because there are
two term-tty2 services.

I’m not sure, isn’t it more explicit if we keep your change of deleting
at most once, but change the greetd example?

The following works for me now …

(modify-services %base-services
                 (delete login-service-type)
                 (delete mingetty-service-type)
                 (delete mingetty-service-type)
                 (delete mingetty-service-type)
                 (delete mingetty-service-type)
                 (delete mingetty-service-type)
                 (delete mingetty-service-type))

Regards,
Florian