Subject: Re: [bug#66387] [PATCH] home: services: Fix race condition when detecting first login

From: Carlo Zancanaro <[email-masked]>
Date: Tue, 10 Oct 2023 00:08:06 +1100

On Sat, Oct 07 2023, Carlo Zancanaro wrote:
> @@ -412,20 +413,29 @@ (define (compute-on-first-login-script _ 
> gexps)
>       #~(begin
>           (use-modules (guix i18n)
>                        (guix diagnostics))
> +
> +       (define (claim-first-run file-name)
> +         (catch #t
> +           (lambda ()
> +             ;; This incantation will raise an error if the 
> file at
> +             ;; flag-file-path already exists, and will create 
> it otherwise.
> +             (close (open file-name (logior O_CREAT O_EXCL)))
> +             #t)
> +           (lambda (e)

Whoops, just noticed this should be _, not (e). It still works, 
because it crashes the script which stops the gexps from running, 
but writes a message to the console. I'll send an updated patch 
tomorrow.