GNU bug report logs - #66387
[PATCH] home: services: Fix race condition when detecting first login

Previous Next

Package: guix-patches;

Reported by: Carlo Zancanaro <carlo <at> zancanaro.id.au>

Date: Sat, 7 Oct 2023 12:08:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 66387 <at> debbugs.gnu.org (full text, mbox):

From: Carlo Zancanaro <carlo <at> zancanaro.id.au>
Cc: 66387 <at> debbugs.gnu.org
Subject: Re: [bug#66387] [PATCH] home: services: Fix race condition when
 detecting first login
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.




This bug report was last modified 1 year and 273 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.