From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YFIGBg2EXmHejwAAgWs5BA (envelope-from ) for ; Thu, 07 Oct 2021 07:22:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 8JUZAQ2EXmEVUwAA1q6Kng (envelope-from ) for ; Thu, 07 Oct 2021 05:22:21 +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 DE1D22A037 for ; Thu, 7 Oct 2021 07:22:19 +0200 (CEST) Received: from localhost ([::1]:51842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYLrG-0001rz-VX for larch@yhetil.org; Thu, 07 Oct 2021 01:22:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYLr0-0001rr-6S for bug-guix@gnu.org; Thu, 07 Oct 2021 01:22:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34231) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mYLqz-0002aE-V6 for bug-guix@gnu.org; Thu, 07 Oct 2021 01:22:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mYLqz-0005i8-MX for bug-guix@gnu.org; Thu, 07 Oct 2021 01:22:01 -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: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 07 Oct 2021 05:22:01 +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: Jan Nieuwenhuizen , 50945@debbugs.gnu.org Received: via spool by 50945-submit@debbugs.gnu.org id=B50945.163358409921922 (code B ref 50945); Thu, 07 Oct 2021 05:22:01 +0000 Received: (at 50945) by debbugs.gnu.org; 7 Oct 2021 05:21:39 +0000 Received: from localhost ([127.0.0.1]:45777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYLqd-0005hW-BU for submit@debbugs.gnu.org; Thu, 07 Oct 2021 01:21:39 -0400 Received: from mail-lf1-f43.google.com ([209.85.167.43]:40809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYLqY-0005hF-Fd for 50945@debbugs.gnu.org; Thu, 07 Oct 2021 01:21:38 -0400 Received: by mail-lf1-f43.google.com with SMTP id y15so19810874lfk.7 for <50945@debbugs.gnu.org>; Wed, 06 Oct 2021 22:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=X94+ojYSCayYNRzoT6T2Qgw8Q6PncW0GbF6fB01aYqo=; b=eLjhxIhJ+rNpQ2kWl2YJ2ohOOwMAm1YTW1UXibTSwZ9l74rgCepovbxDbEujLfgl5L qrnGGesSoOa++ePg3YQQqA+c+0jLxG2c26ZpEDLHFuoJoP70KVQC0faSHsafc1kXfr3c JTHdR1NEqmuH3KthjCgHsC3oJ7rjsjN4yvkF4pfq7e7rTHx5uVq6vRjdyFWjCctAy1Vm FRRKHuC5xywZz0VDgVVe1YF4ntIiOC3evAGKHj1G7yHnNX8q7AIGMikQsCLvPgwn0C43 EkAiHJWqEaNJzWB/HgjaTUfzVLd8P4EqUkpjjFJCaClqfS2yLufxm+CFnALHEPlrjJ2Z BhNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=X94+ojYSCayYNRzoT6T2Qgw8Q6PncW0GbF6fB01aYqo=; b=g3vqXug3hQsvzmpbRxYGo8RRFS4mgT42QizquVhKJnDQoip7Fj1z/kDl7pqTDSjVCy bv1mRYB624dmltr1QZwI01/7uz1bM24J3NPx4/Ka/UuKaiBMLHSUJFEjL0TSq1vVWF9d t6NZ7O3XBI1U/LpVvmEtubzBD0rumkrJnV5AUic8hUQUL3PlVW5ugqDfbWf0e3jl2b9t R+CHs3LLN4wHD56zaJxrsRNIqbRcup4JLzShYL6oMzEmII+R6VQ/owUOc0NOdBBvI4+8 TZJCxr7yQdj+I8nMWNNGdmPk6uScLvSuGJ9aRdJzVrGnTzYuRaBObJssYvIUivKZlR6a 456Q== X-Gm-Message-State: AOAM532oVCr1/un5RhCZ1+/coD0mUiALUrpx3pzLe7FGF7C5/D5bMRYk twXQbHDAP+oSSyevKyZMm70Qqg== X-Google-Smtp-Source: ABdhPJxyhZES+/PqSwXhgp5520WsUFr8teLPFsEAlI37OZn8BrtUXSbjSsCJ5CADBd7buOgapV+SAQ== X-Received: by 2002:ac2:518e:: with SMTP id u14mr2149825lfi.338.1633584088400; Wed, 06 Oct 2021 22:21:28 -0700 (PDT) Received: from localhost (109-252-140-132.dynamic.spd-mgts.ru. [109.252.140.132]) by smtp.gmail.com with ESMTPSA id a8sm1156021lfu.202.2021.10.06.22.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 22:21:27 -0700 (PDT) From: Andrew Tropin In-Reply-To: <87y27czr0v.fsf@gnu.org> References: <87y27czr0v.fsf@gnu.org> Date: Thu, 07 Oct 2021 08:21:24 +0300 Message-ID: <871r4xwgtn.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; 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=1633584140; 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=X94+ojYSCayYNRzoT6T2Qgw8Q6PncW0GbF6fB01aYqo=; b=GlSLvVkUhuYLC+EpGwmUPXENVF4tXOm9Sdv8PAPoOA1/p65e14UsHMAjkkDJwgeU9DxcR7 2vojU2JRE7y7NiJyVBdZn3g86zXv4b9OCs8Vper2Cvmi97J5tIX5e/TPqyii2hZx+e3mPg IdRJ4O+XB6HtgtxnBdBt78Vr5/vhII/TzuNyKMy8sSdoNxogG27C00Bdg2AlaWqhaAnpLc MNGWvw97UkSIU1Z29KEcgu+CJVRzNQoQbdgAQJSevQ3ewT3pmReYXzK6jDON8VJ0M7hJjf 1hBjobIcI3Jn9veWpu6JioBmqnhfeIJYF1DqCqWMPqD4+dySv5lV9OFnFYe/SQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633584140; a=rsa-sha256; cv=none; b=j1BKo8GCSqeUJzmngbmRJv7cZrheFzJanQs/9hUVgxKmuY0q9LbFG993GBUoW9Y8ShKWrw moAsxzuVhzY/5GJ31owZNbMgTdEP+4N8o79EoBuZ9W04r+FjlB+DoY9tKQqn3EnwS7XKgy PLa/Nwgh2wCrMN7/EyE0Ccc3LpVq4d1GcuWmFBqqwqodMqcKuroXiLFL3dGXESg3zYqu4A CD/2KTP+aAkvPq+n1bhYvbXcub32p3zFl43kByQ4qgAK6ypWKOIHEPVsLcD7bGKpf9244h Pu51MRtmQZYF6FPP/zaMcO9jAH9b+J4kSNNH9U9QdZ2EqAhGnYzvWbnHU17JXA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop-in.20210112.gappssmtp.com header.s=20210112 header.b=eLjhxIhJ; dmarc=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.52 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop-in.20210112.gappssmtp.com header.s=20210112 header.b=eLjhxIhJ; dmarc=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: DE1D22A037 X-Spam-Score: -3.52 X-Migadu-Scanner: scn0.migadu.com X-TUID: xtW/yVlnHHty --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-fir= st-login-executed" > --8<---------------cut here---------------end--------------->8--- > > Upon a console login or ssh login, /var/run/1003 is created and all is fi= ne. > > See below for the scenario, home-minimal.scm is attached. > > Greetings, > Janneke > > > $ ssh guix@localhost -p 2222 > guix@localhost's password:=20 > Last login: Tue Jun 23 11:45:08 2020 from 2001:980:1b4f:1:216:d3ff:fe29:7= cdb > guix@dundal ~$ guix home reconfigure home-minimal.scm > /gnu/store/fgxpmf1iwjp9f8dfyaf7wxqa8105lq3w-home > Cleaning up symlinks from previous home-environment. > > Skipping /home/guix/.config/fontconfig (not an empty directory)... done > Skipping /home/guix/.config (not an empty directory)... done > Cleanup finished. > > New symlinks to home-environment will be created soon. > All conflicting files will go to /home/guix/1633101995-guix-home-legacy-c= onfigs-backup. > > Skipping /home/guix/.config (directory already exists)... done > Creating /home/guix/.config/fontconfig... done > Symlinking /home/guix/.config/fontconfig/fonts.conf -> /gnu/store/phj2z2i= iqdhryfy7mqral0b9qz3hlva6-fonts.conf... done > Symlinking /home/guix/.config/test.conf -> /gnu/store/bdixb09v30bvhpgi2f6= ndiq25wzb9l74-tmp-file.txt... done > Symlinking /home/guix/.bash_profile -> /gnu/store/j3vhlswj46psxicapnq8c9p= 1jrwd55rk-bash_profile... done > Symlinking /home/guix/.profile -> /gnu/store/fxbppk3pqzdi3zzy0xl5vg1ir6c5= jzq5-shell-profile... done > Symlinking /home/guix/.bashrc -> /gnu/store/513j2xkszmcmv7fiawh59mr0i1fmi= n55-bashrc... done > done > Finished updating symlinks. > > Comparing /gnu/store/fgxpmf1iwjp9f8dfyaf7wxqa8105lq3w-home/profile/share/= fonts and > /gnu/store/fgxpmf1iwjp9f8dfyaf7wxqa8105lq3w-home/profile/share/= fonts... done (same) > Evaling on-change gexps. > > On-change gexps evaluation finished. > > guix@dundal ~$ guix home list-generations > ]8;;file://dundal/var/guix/profiles/per-user/guix/guix-home-1-link\Genera= tion 1 Oct 01 2021 12:19:16]8;;\ (current) > file name: /var/guix/profiles/per-user/guix/guix-home-1-link > canonical file name: /gnu/store/fgxpmf1iwjp9f8dfyaf7wxqa8105lq3w-home > channels: > guix: > repository URL: https://git.savannah.gnu.org/git/guix.git > branch: master > commit: ]8;;https://git.savannah.gnu.org/cgit/guix.git/commit/?id= =3D56b10709efc4eb35df66f52a20ce3cb7fab4fee6\56b10709efc4eb35df66f52a20ce3cb= 7fab4fee6]8;;\ > configuration file: ]8;;file://dundal/gnu/store/kjha5z8mck0pa9jrgx2266r= q1lvlb3ji-configuration.scm\/gnu/store/kjha5z8mck0pa9jrgx2266rq1lvlb3ji-con= figuration.scm]8;;\ > guix@dundal ~$ logout > Connection to localhost closed. > 17:26:49 janneke@dundal:~ > $ sudo -i -u guix > Password:=20 > 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-fir= st-login-executed" > guix@dundal ~$ ls -ltrF /run/user > total 0 > drwx------ 7 gdm gdm 160 Oct 1 12:16 971/ > drwx------ 13 janneke janneke 260 Oct 1 13:07 1000/ > guix@dundal ~$ logout > 17:29:34 janneke@dundal:~ > $ su - guix > Password:=20 > 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-fir= st-login-executed" > 17:37:33 janneke@dundal:~ > $ ssh guix@localhost -p 2222 > guix@localhost's password:=20 > Last login: Fri Oct 1 17:23:35 2021 from 127.0.0.1 > guix@dundal ~$=20 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: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-home-services-on-first-login-Check-if-XDG_RUNTIME_DI.patch Content-Transfer-Encoding: quoted-printable From=20aab6df0298963fe91a6ebfd1dadbc1530eceeff7 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. =2D-- 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 =2D-- 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. =2D (when (not (file-exists? flag-file-path)) =2D (begin #$@gexps (touch flag-file-path)))))) + (if (file-exists? xdg-runtime-dir) + (when (not (file-exists? flag-file-path)) + (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."))))) =20 (define (on-first-login-script-entry m-on-first-login) "Return, as a monadic value, an entry for the on-first-login script =2D-=20 2.33.0 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 Best regards, Andrew Tropin --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmFeg9QACgkQIgjSCVjB 3rA7AxAAj/q+C7jdnSnrWrEhjcrs8MXy/hXg5lmztAppf7K0WWYBCwJLvxtXPRGL 6JzwpVseM4FSa3pboDheKKqGfe0SjH22w26qQzABzuNhdTZ76Xr+sQwXcaIAN2f5 8+zBTAOGwVJJBUJSShp8/Ab0dJyeaZQqVpj07GwvFbtKvf70usthKrRB0W2Q0Y4S HQMdd+T8NYKQMDrJY+FcBM3V75RXr0o0AD/ypUDLr8+fcS1KnlvcV/o5PNJLwFO5 U2WphVsNBuy5jFAk7ZrabcXmZPDCyABYDSFHkB47xFq2uYgl7ymVoztCleCCbtPa VWB//OWL1JBjbxXsR09U2ay//S3+gvh+GaTSic2RI81jl07IJmAX5LlQRLA5HUiy bEwhxGiu4HXc5rvFO0cysSbnUTauxQVtpOL7jHjI123aaVAsnu8Pvn/tFzbNGn4i obYpHF6D5KNkBayxt2Ku022fOYVdZwul4/ZXxnDD6wWZxFmIHOtptACcGDcsqKPF lY9dAPsAHI10KSpaALI5AwuHZPtcQ4/KyHv/fAtQh2PhAfYyckRepNw4iUwoA3oq hmNdU3dJ9oFa4tCVZcSjvQhHlTdTRijgY51ZNslv1iLlPoi5bg7UZW9254BZHSCn yjUNuXG0YjeFww4QStv3XBVz/M5BDRw9/JMksaDMq6QsPKDAI94= =PzFK -----END PGP SIGNATURE----- --==-=-=--