From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id ELG3MeBihWFdmgAAgWs5BA (envelope-from ) for ; Fri, 05 Nov 2021 17:59:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EJ9VLeBihWHnIwAAB5/wlQ (envelope-from ) for ; Fri, 05 Nov 2021 16:59:12 +0000 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 883246A97 for ; Fri, 5 Nov 2021 17:59:12 +0100 (CET) Received: from localhost ([::1]:54114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mj2YZ-0006DD-Q3 for larch@yhetil.org; Fri, 05 Nov 2021 12:59:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mj2YQ-0006D3-RH for bug-guix@gnu.org; Fri, 05 Nov 2021 12:59:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35469) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mj2YQ-0000Zd-Ik for bug-guix@gnu.org; Fri, 05 Nov 2021 12:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mj2YQ-0005fy-IC for bug-guix@gnu.org; Fri, 05 Nov 2021 12:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#50945: Guix home: No such file or directory: "/run/user/1003/on-first-login-executed" Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 05 Nov 2021 16:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50945 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Andrew Tropin , Jan Nieuwenhuizen , 50945@debbugs.gnu.org Received: via spool by 50945-submit@debbugs.gnu.org id=B50945.163613152121776 (code B ref 50945); Fri, 05 Nov 2021 16:59:02 +0000 Received: (at 50945) by debbugs.gnu.org; 5 Nov 2021 16:58:41 +0000 Received: from localhost ([127.0.0.1]:47013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mj2Y5-0005fA-Jq for submit@debbugs.gnu.org; Fri, 05 Nov 2021 12:58:41 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:33804 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mj2Y3-0005ew-MJ for 50945@debbugs.gnu.org; Fri, 05 Nov 2021 12:58:40 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1636131513; bh=JU6lJRvInq6qfO2o3+ngCcdtU6YAsHsA4BdVUHkXDrY=; h=From:To:Subject:In-Reply-To:References:Date; b=FcPWxrpTQ+KKofkXJghElCTH1TG15I1IK10RPmllgN88nmPhnkFZgEgaPpKkziKx7 52ghE6EBqyNW4NKmgk+2GlAoibY7Za8E571aQ/83lHVKQZ0YTugGeqRsj51DQ1cSa8 cpdfFlsS7KcwC+u70swxBY5yzhwFTa6lOO9HEo30= In-Reply-To: <871r4xwgtn.fsf@trop.in> References: <87y27czr0v.fsf@gnu.org> <871r4xwgtn.fsf@trop.in> Date: Fri, 05 Nov 2021 17:58:29 +0100 Message-ID: <87ee7u4k0a.fsf@disroot.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636131552; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=4UVgJJ3YeVSMu4bMcX3uXuN7vbPJKZGGp88mVavJBSQ=; b=MXyyhWnFzZSEIU4B2uVY6lA1vm7YyUbNAUAnDe8NNf1pnpmcei0kJfQoLP2MCLDuaO5Taa sXIP/tqYwdkg3S6pxaNon7a8+B7xjyA+vYf5BCYhBkpZWr2uuHpWXEwk59v3/FQUp6P72K bSCLo0j6fISrOw76S9jhlmhUAwGosyWM0Mrmae7mi62zJQXpQZR+tSccZeq3N0Iomnxic1 6C4PMLivdAfU7gNnQMDxnTT0vjLdi8UOHi1cjc+KTSZuntMbav2wZwluDgREfNSiFzTJU4 MXSP7QMv17mthLqugpESciU/N2nvAjC9GoSHIalVVPcvALS4cY90RT7XaSlTCw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636131552; a=rsa-sha256; cv=none; b=sZQMKCM0kQijnOTFMBco3SfZWR3L+x+xDxKVnXvZ+TPtFCJYQP92G6zeWXlXmW5AfGIUT8 9xlOZwZ04RbKqTjjsB1f5+lRYSeHlpvtyYJGBH6mBdlo/MVSUPrsneiC5tPiGav4GhNsiS drlHrUZtjUonf7XZbguf0lEboYni35iIqY7E+YWkmu/HZg0kg7dC/ZsovbmTEL3pUFPQNn lxVH3nsc681LfVF95Qnj1JqMpyHlMBwjeGGAVPSRgnDHfazKND/f+KFRh9PZP+7ZhW/dSi IbMPz+tF9A/fp8XDcwlrywutfaMOkvncLCyl7u8R8KX3xwyxd/GHFmCD8GPFMA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=FcPWxrpT; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -3.42 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=FcPWxrpT; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 883246A97 X-Spam-Score: -3.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: C7yRqxG9NFIk --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, On Thu, Oct 07 2021, Andrew Tropin wrote: > On 2021-10-01 17:46, Jan Nieuwenhuizen wrote: > >> Hi, >> >> When using su or sudo to enter an account managed by guix home, I get >> this error >> >> --8<---------------cut here---------------start------------->8--- >> Backtrace: >> 2 (primitive-load "/home/guix/.guix-home/on-first-login") >> In ice-9/ports.scm: >> 461:11 1 (call-with-output-file "/run/user/1003/on-first-login-=E2= =80=A6" =E2=80=A6) >> In unknown file: >> 0 (open-file "/run/user/1003/on-first-login-executed" "w" =E2= =80=A6) >> >> ERROR: In procedure open-file: >> In procedure open-file: No such file or directory: "/run/user/1003/on-fi= rst-login-executed" >> --8<---------------cut here---------------end--------------->8--- >> >> [...] > > Thank you for a very detailed report. > > pam_elogind doesn't create a session, when the login shell spawned by > sudo or su =3D> XDG_RUNTIME_DIR not get created =3D> this message appears. > > I think we can omit execution of any processes by on-first-login script > in case session wasn't created. Added the check: > > From aab6df0298963fe91a6ebfd1dadbc1530eceeff7 Mon Sep 17 00:00:00 2001 > From: Andrew Tropin > Date: Thu, 7 Oct 2021 08:12:04 +0300 > Subject: [PATCH] home-services: on-first-login: Check if XDG_RUNTIME_DIR > exists. > > * gnu/home-services.scm (on-first-login): on-first-login won't execute > anything if XDG_RUNTIME_DIR doesn't exists. > --- > gnu/home-services.scm | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/gnu/home-services.scm b/gnu/home-services.scm > index 9f1e986616..0b77a1321d 100644 > --- a/gnu/home-services.scm > +++ b/gnu/home-services.scm > @@ -286,8 +286,11 @@ will be put in @file{~/.guix-home/files}."))) > ;; XDG_RUNTIME_DIR dissapears on logout, that means such trick > ;; allows to launch on-first-login script on first login only > ;; after complete logout/reboot. > - (when (not (file-exists? flag-file-path)) > - (begin #$@gexps (touch flag-file-path)))))) > + (if (file-exists? xdg-runtime-dir) > + (when (not (file-exists? flag-file-path)) Use (unless =E2=80=A6) instead of (when (not =E2=80=A6)=E2=80=A6). > + (begin #$@gexps (touch flag-file-path))) > + (display "XDG_RUNTIME_DIR doesn't exists, the session wasn't > +created, on-first-login script won't execute anything."))))) It would be good to tell the user how they could manually run the script, that way they could manually set/create $XDG_RUNTIME_DIR and run the script. "XDG_RUNTIME_DIR doesn't exist; the 'on-first-login' script won't execute anything. You can manually execute the script by running '$HOME/.guix-home/on-first-login' WDYT? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmGFYrUVHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5UuAP/RI/AZBKmH088uB629hRt5X+y69x JENCOTUBYP9VPzPx0uKA7COYRCc7Ac4d1OozDnXyp56kd3fTi+YnDbhjjrIo5MQo RmzaoGvGwAGy142mFt6lJ2H/7S/2GirK7v1O6eOLZfV96AEruVeJpkMjmQ9X3X8g paTcJz5Vid88ket5k7hbL4S/ZZh3hqkEJCYWX3Dt5myHc3gJvEalfbApvEA9qBLC hLt7627shDD3krafMEI+/Ytj/00fSExBnwPEwOsCcUpzGZQOea5reW3FHdBdEcqs NML+MG8sxcil8K0lZMBvWnUbow+HOaglu4HpmgwJ1SuO5DY1rJg888V6znq64+83 BWDsgh7JzT3TbKVji77Nx6CyMRgOrBG0AYI1mNB2TNMcUTifocRJK8geGT3jnYM2 DSCHVjGIlNhdwwYo0Toe8D9tz/EnAHYgjhIqmHgNKpv3XKpbPi0zcu3T1t0l9r6Y Sl2xWV5i7rxYzh2ycmWsTMBnVoyoCzLjuzw/4eNSNx7ZzUAendpIzx7vK2ii9GVr w7XxinI841/bsD1/r+jZ/PHrZd3JoLVErWiY9bQiHXW9M1dubvIyZ5nXziOCw6Cr KsIDUSdQdsU0rNDhECkPDJUAaSUao+lfxSCQJI5g2nBxHnLvXu/h0zJg1Rne4Tgx IHYXA1PEdY2gYgns =UnP9 -----END PGP SIGNATURE----- --=-=-=--