From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id yJ4EJgeW0GRgbAAASxT56A (envelope-from ) for ; Mon, 07 Aug 2023 08:58:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id yBbxJQeW0GStXwEAauVa8A (envelope-from ) for ; Mon, 07 Aug 2023 08:58:15 +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 0AC163E83B for ; Mon, 7 Aug 2023 08:58:15 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=pe7meGko; 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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1691391495; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to: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=FZrE1IjWFHZDQo3q9+7i08Hes2zi6bOFmCH16ZRpePY=; b=QXMJFWQdhSb1guAlhtinc5hM7UGUj8bHIiTEzI0iK7fW0tfcrB8LaLU4eXKb4/qGVzDfVa aURecQ+yvpaaz7UBZ32nt8XPUYzD2uIumnlZZnDQfKt8bPD/GevxxKubrWkJwpMGDUHwvl RHlxU9yW3DXXaY0vKL19SGbxkadJ/5F29JK10LsD9M4krND3r/M719mMZgfWmTWmDdvj7S zAEy0RjMFabD/ckM+EoK5hX56zIqGj2k7UjEGw6lCfPBdrsDunBSU9GHy+h4bOKyDWbLWP k2FqORTUXX537jVsLp1IrWzhfzWD0ULHl9DzDU52WZ461v2xQzGXtmEC+o/MoQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=pe7meGko; 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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1691391495; a=rsa-sha256; cv=none; b=rKZGE3ct8rQUVmHAO8S2ZPlKx5tn6k5rP1p86aUNLIRxKqIwbEF9uLMDIwRoxT/F6TjjJZ GjW6uilkTl2EzlscOyi+PO2KCODkqZUsnMKLkHkthYDohEBzqyyyf8ylPJpCD21XNdZ7V6 cccklEBEwcPEEseH2P5QU8M+4ffEQ9bWuWlvwgPu1DlcAhLXYckKMAmnGAGQBvZRMrnSjm 9I3nor95LCQ88e3bY5uvWlJWNPZZQgxSqciQeoIdhuY/tYpMrX4HZiDcgkTc+2Zh4NHd0B xRJfC8mxVdN4Pgk4GPfuvqwIv2bhuJwbc9wnBTTixFCAxKbT9ydWd79i0E50sA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSuBo-0005JB-AE; Mon, 07 Aug 2023 02:58:04 -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 1qSuBm-0005Iv-5J for guix-patches@gnu.org; Mon, 07 Aug 2023 02:58:02 -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 1qSuBl-0007vQ-T3 for guix-patches@gnu.org; Mon, 07 Aug 2023 02:58:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qSuBl-00043b-OG for guix-patches@gnu.org; Mon, 07 Aug 2023 02:58:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#59983] [PATCH] home: Let user configure XDG base directories. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Aug 2023 06:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59983 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Antero Mejr Cc: ludo@gnu.org, antero@mailbox.org, 59983@debbugs.gnu.org X-Debbugs-Original-Cc: ludo@gnu.org, Antero Mejr , Antero Mejr via Guix-patches via , 59983@debbugs.gnu.org Received: via spool by 59983-submit@debbugs.gnu.org id=B59983.169139147315571 (code B ref 59983); Mon, 07 Aug 2023 06:58:01 +0000 Received: (at 59983) by debbugs.gnu.org; 7 Aug 2023 06:57:53 +0000 Received: from localhost ([127.0.0.1]:60438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSuBd-000432-3U for submit@debbugs.gnu.org; Mon, 07 Aug 2023 02:57:53 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]:50419) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSuBa-00042k-72 for 59983@debbugs.gnu.org; Mon, 07 Aug 2023 02:57:52 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id AF0BBE0003; Mon, 7 Aug 2023 06:57:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1691391462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FZrE1IjWFHZDQo3q9+7i08Hes2zi6bOFmCH16ZRpePY=; b=pe7meGkojHP4CnDZJdPPCcV6HHX8VdRXpHRlLL3aJfwDiz6d0vQnKUP4hCfJr2VAb01cK7 zrAKDi8Zkl1DqXYH9Pimg76K3Yc0Ej0rXmCwSxeISemJO3h9HluUffzwcwbWj/d0avfEMD xMMD724kxIra23ACg4cmxvShBnkhmCnS1K3CjC/SjztinxxJk+9cLv3bd3B1cCYqSPz/3j HMK2hkEYPsFI78nTgmJpWAHOvzHuEYUrsetx6R7nrRP9O2pNLeb5Mn1nbwLCJxg5joXx+W NukMFwtQltPBU4M3qtgQWYmTkXgoqJzjByTrUiYL9qcaNPO4UHNYsBNoihMeUA== From: Andrew Tropin In-Reply-To: <87y1rbthce.fsf@mailbox.org> References: <20221212030049.4725-1-antero@mailbox.org> <87cz8o9bgz.fsf@trop.in> <87y1rbthce.fsf@mailbox.org> Date: Mon, 07 Aug 2023 10:57:37 +0400 Message-ID: <87350vl4pq.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-GND-Sasl: andrew@trop.in 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-Queue-Id: 0AC163E83B X-Migadu-Scanner: mx1.migadu.com X-Spam-Score: -3.31 X-Migadu-Spam-Score: -3.31 X-TUID: 4+j4TZqcalst --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2022-12-13 15:53, Antero Mejr wrote: > Andrew Tropin writes: >> There is no way to understand upfront if directory containing >> XDG_RUNTIME_DIR is writable and this is why it's a good idea to delegate >> initialization of it to external thing and never try to create it here, >> even if it has non-default value. > > Thank you for the snippet, that's a much better way of fixing my issue. > > I still think guix home should (by default) be able to use all its > features without the requirement of having external programs installed. > > For example, suppose you have a server that you want to set up your home > environment on, for when you login to do sysadmin tasks. That server > wouldn't have %desktop-services (elogind), nor would it have a custom > greeter like greetd. So XDG_RUNTIME_DIR will be unset. > > If XDG_RUNTIME_DIR does not exist, can we make a fallback path to have > guix home put the shepherd socket and on-first-login-executed flag file > in ~/.local/var/run (or somewhere else writable) instead? Without automatic cleanup (which is the case for elogind, pam_rundir and other options providing XDG_RUNTIME_DIR) it will likely missbehave. It's much trickier than it seems on the first sight. Theoretically it's possible, but requires a lot of additional work to do it right. In fact on-first-login script is a kinda hack to make shepherd started somehow, but running user's shepherd is tricky on its own. Shutting it down correctly (and all the processes managed by it) is even more challenging. AFAIK, there is no easy and straightforward solution (even in other init systems that we can quickly borrow), so it will require time and effort to carefully design and implement it. If you want to work on it - send you ideas, research and patches for the possible solutions, I'll share my input :) =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmTQleEACgkQIgjSCVjB 3rDqyA/+Ifuvgo/hUJbOO/h3HV9DocSM4vg7VWybqB4wpv7/CeJ0VFg+55rxwTwH Zyd9s+uo5++C5t2ausObDGG69PuFUY0Pksnb9kWIntw2R045O85LbbXEW1lYBQuV u0yE/u80RhgJcx2cg9pfY8+rrPd+47Jkag4gWcb8ccgARLTnTbu+2/4w3DuzkM65 hynWQKr0zku2o5e33I7+Zks96KJDApMpP54Vhunl8W9wtRJfsiLUygmzFuEA2IGG TMrNXBRJdAhyZpeBEpFcrtc3Qa8+1OHSg/UmGd9OmCfLYneA4IuN51qaDmZ4LjLU sWiQdjW4BXQhhWg44wz+NwDNFBMK7jBHZ+/42Yh1ArQWJ61av3XnhjvBVyVrQPFw vAZFfNAUgLBLSKHWs9fXF05NuIJLf3cWl+DS/3g7Aq8N29sH/1OeEw/F9PIvuDoX XaqostVLGlAiTnyMkpUeHnzQsRYTZg7+fA8Qhtj2Jva6/fTvWvckXcJhjCd+RLck dZrcIgkU3kqBxioCKwwNNJ70VAffPqH8iDDMwptGIjDrJnI+sQz/gH0mCqx6Zepj urG9kvZRnw3+KiSe2QnhEaWP8zGyfiaqTV43xL3MkxVZmwFywrkurM9QEMQKg3oC FEoRU7OHn5kKXhULZOz1a2alWOZnGPLr/mnb0vXOf29gnQcxtEI= =gdmK -----END PGP SIGNATURE----- --=-=-=--