From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id KOOeCvb7I2WOgwAA9RJhRA:P1 (envelope-from ) for ; Mon, 09 Oct 2023 15:11:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KOOeCvb7I2WOgwAA9RJhRA (envelope-from ) for ; Mon, 09 Oct 2023 15:11:18 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D956447556 for ; Mon, 9 Oct 2023 15:11:17 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=zancanaro.id.au header.s=k1 header.b=PjMAzyOT; dmarc=fail reason="SPF not aligned (relaxed)" header.from=zancanaro.id.au (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1696857077; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=+dcUXIAtvy6Mbfm3iyskgBZCHKvM/gp109lBWYItk5M=; b=X5pbROo6bhALPofUC24mRdYSGFTy2SHLOd1gl6a61R9joQQQcmKJb2DeyqaQkvPYqip5kb RA4ANJmq1GGgwIpK9NcIAAuGuPN1HNlWkcI7Yn/kbtduB86pspSzy0Wh7PTs+AmYvywCCs qYm3lBStPWLdxLwM9u6+QndQfejK19EEZMGmtRu3XXYQA/syvxBejoD3YVZ5bAAQ3xH9oJ u+PQ0+9fLMrTRjs/eh3MmedJlQXhtaEueoCsMf30wmkdBSOeIww0ehiy4WOob+lSgCu6Ze ahm7IHmormkI7FkO6gDYFZmFPMcuSR4R5I2CB4clPFMsZptm33VbqJ8zAggUrQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696857077; a=rsa-sha256; cv=none; b=S4AW2MtNQpfRJ0Uw4aqbYtIpbPh/j2AlkiDqCZWZJQwQ6W5IhkyG7NNNFrptad1cQyZ8MC 6XrmGkya0yclJH9nf76QYg4mvCv/vWgOnSOh27pbSQ+kItN9MCKc+HB6FU1EJEtBeziKNZ MJMsWACPYkbMFX3ksCAfUSZdRQpBbU/CqoKF9DncOo4mCYG3gUl8+VMBNkGF1UrRlOQGfW poV4Q62l1fpbIqicmrLJOd+6pR3YheWpFyLpBpxJZa0IHznGh5TmosJUrdnCeRI682IcVm TGC6S+bJMDU2lrwfSPMNVzOzFyuSOxVGokNpj8jxnNYT/0alES1j4qJQ9+vUmg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=zancanaro.id.au header.s=k1 header.b=PjMAzyOT; dmarc=fail reason="SPF not aligned (relaxed)" header.from=zancanaro.id.au (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpq2D-0001fc-L7; Mon, 09 Oct 2023 09:10:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpq22-0001bY-QY for guix-patches@gnu.org; Mon, 09 Oct 2023 09:10:51 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpq1y-00046t-3X for guix-patches@gnu.org; Mon, 09 Oct 2023 09:10:44 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qpq2I-0007li-5n for guix-patches@gnu.org; Mon, 09 Oct 2023 09:11:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66387] [PATCH] home: services: Fix race condition when detecting first login Resent-From: Carlo Zancanaro Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 Oct 2023 13:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66387 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch Cc: 66387@debbugs.gnu.org Received: via spool by 66387-submit@debbugs.gnu.org id=B66387.169685704429817 (code B ref 66387); Mon, 09 Oct 2023 13:11:02 +0000 Received: (at 66387) by debbugs.gnu.org; 9 Oct 2023 13:10:44 +0000 Received: from localhost ([127.0.0.1]:59515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpq1z-0007kr-Kk for submit@debbugs.gnu.org; Mon, 09 Oct 2023 09:10:43 -0400 Received: from voltorb.zancanaro.id.au ([45.77.50.64]:40768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpq1v-0007kR-Vu for 66387@debbugs.gnu.org; Mon, 09 Oct 2023 09:10:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=k1; bh=+dcUXIAtvy6Mbfm 3iyskgBZCHKvM/gp109lBWYItk5M=; h=in-reply-to:date:subject:cc:from: references; d=zancanaro.id.au; b=PjMAzyOT0ry7bt9rrG2Nj9emjSQgn3g6DS38a EAgBVVgXkWvJZok1rM8r+IGpQfC8s2qb0zzMnbFFb6/owHE6WNkzXxGFG5/TdAPXctyh44 hQFqCiTR+UhdctknFuijui+RMPBvRgkZUtl3aGxD6tfrmMfqAiKr5FuM4ASEXxJ4= Received: by voltorb.zancanaro.id.au (OpenSMTPD) with ESMTPSA id 346e88bf (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <66387@debbugs.gnu.org>; Mon, 9 Oct 2023 13:09:52 +0000 (UTC) References: User-agent: mu4e 1.10.7; emacs 29.1 From: Carlo Zancanaro Date: Tue, 10 Oct 2023 00:08:06 +1100 In-reply-to: Message-ID: <87bkd8djri.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -3.11 X-Spam-Score: -3.11 X-Migadu-Queue-Id: D956447556 X-TUID: ThiOXA21s22O 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.