From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 2CuUNTo2b2fUYgEAqHPOHw:P1 (envelope-from ) for ; Fri, 27 Dec 2024 23:20:27 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 2CuUNTo2b2fUYgEAqHPOHw (envelope-from ) for ; Sat, 28 Dec 2024 00:20:26 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=UkBqu5Xc; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=W6fOgo3j; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=plKTK5ET; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=wolfsden.cz (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735341626; 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=wntGGIlh0X2rZPs3EGHJgWbUEgX6wv8xIs61SsMtqFY=; b=iTAKt0Khe5KA6CNmKMbVEi0ETsv+AAdOnhBpSxj9pkfjEefAatUc2TpGaXR65ZhMH+ZwUz 6jvTUTVc7W7CqhwUnQM0LzxmVe8mteLfKmLobBqTmXggWzUm/+G9qGL1c+CdS3fgkn6qNJ L0A2QQ/VoEAME/Cvhz3GSXcJ6oRfH76u/KbUWgNtCkVLqzT3Rl43TbV/f3bORT2SGoAku5 ebRCs6Q5ntEoo1OHDoWd9xboNbqlRW0J2d7mBu3by+qMgluG9CgF+nCAFy84n1+Ty26sxo E3TE5EaeJcg35Bxf/DaTvpzPG4Y3NwPFL6RkIlekKcy4hOwpMljfLFHAf0xNiQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=UkBqu5Xc; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=W6fOgo3j; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=plKTK5ET; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=wolfsden.cz (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735341626; a=rsa-sha256; cv=none; b=D7WVqICgn9sT15+wYZEnNCCmMlcsVXoDDCMH5S6goKs+SR/sOYf2Pe8orhHEC11yFyqsPt Fge8WN6T0/+y8ARPrd3D5O5uleLGNGM9/Gao+pYxufFFg6iFxVpEZTlmXZ4ZPBAfTZBolL rNFNvvJFDo4LktoAPcwFQ0maIo4zzx20GWbDqjELrhmPnNIiyJUDi2iDl4RugIt6Xg+ozY ZVvkD7O3v1A4Hs4ri+SOytdeodlp4/vFOW2N6fEPocG7YxkFIeQZLB73NKJ3Kh2GDvgoTY s1GiDJt4FkBJMGMRCtbx3ML65OgKQPLy4fV6/uSHU9hGMZ9Di4QQVcSE0HeLPw== 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 8581878F95 for ; Sat, 28 Dec 2024 00:20:25 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRJci-0006v9-T4; Fri, 27 Dec 2024 18:20:04 -0500 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 1tRJch-0006ut-33 for bug-guix@gnu.org; Fri, 27 Dec 2024 18:20:03 -0500 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 1tRJcg-0004cc-Jl for bug-guix@gnu.org; Fri, 27 Dec 2024 18:20:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=wntGGIlh0X2rZPs3EGHJgWbUEgX6wv8xIs61SsMtqFY=; b=UkBqu5XcqTMGjIrXOJGTM4QaBbSxafBYKRmNN8dkfYLyFetN008nOG8HbkLrxQhghoAIAyWzrEzEhh8rHaw8A8gVPwemXxI9D749dUYm84wdWnRCWidWXbB8UwFtMOKsdst8drpPCTZPSQTl5dZOcmGEd3vO1KS3lMvPEyi9oxmSIa16bxoL9/N6EwbLmz5KoLIJaksgTS9inCV7MOW48ypD/L+F+ngJ5KJzZhZZlF9cuWyCZvW9/ZfZHAE7FMPalKp/n9GcuvuwlqrbXdKUpk0HOqWtG5a5ApRrRTZV+Nms8raM30oo9u7oxWx9USjAtumcfHjd8I77WarDHpNjOA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tRJcg-0005z5-8p for bug-guix@gnu.org; Fri, 27 Dec 2024 18:20:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#74912: Shepherd: Growing number of user shepherds when relogging Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 27 Dec 2024 23:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74912 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Jake , 74912@debbugs.gnu.org Received: via spool by 74912-submit@debbugs.gnu.org id=B74912.173534155022905 (code B ref 74912); Fri, 27 Dec 2024 23:20:02 +0000 Received: (at 74912) by debbugs.gnu.org; 27 Dec 2024 23:19:10 +0000 Received: from localhost ([127.0.0.1]:47960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRJbq-0005xM-5F for submit@debbugs.gnu.org; Fri, 27 Dec 2024 18:19:10 -0500 Received: from wolfsden.cz ([37.205.8.62]:57254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tRJbn-0005xB-3f for 74912@debbugs.gnu.org; Fri, 27 Dec 2024 18:19:08 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 58B0E338E04; Fri, 27 Dec 2024 23:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1735341546; bh=jcZnzcsduPSJ/S5JGMMwQy+P4SbnUFpuRAVXdy3+tSs=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=W6fOgo3jbTARROXyq12HpErKicYL8sS2Msc9WygjQCisi2S/DIgPtjLY+70BBtSou LvVTUDuePNr2Ko09kwuXalGAuGCYPIXb1UTGrk19DdcLi9Q0U1zA5lDuuzpbMcPZkm htPHY0wjtGeK8ArgfASZYqYyPfni9Qi9qPScvyYY20eB6F3amMW4hLCRMdnFC+a0EP LGOXtNeng+DTzuBFpf0ITeyom1iydggYtbrLeW8GdTCgYPa9zTqayex1N5tz/2YdIn XtvNmySvfg25pKQX2ToMDz6S5qfn4TgLZ/mSpeEzUb0PoJC3mV4XPALpU/TL3POZO7 mcRZUXCoTzTI/nI7eGZwQUvcDbluWviLFUCYIXaW6dF2kn6IJ2/JxpFeqwEKxQxOMO MhdAQiaZxD9PJ8B+1ipm0nDWCOCMIbyNkHPUyP2gBssnJy39Df6lzjZgD1psQG/NwC fKVRoDlMmONwaGf8JtTZF+42ayqyCe3wgr4xfmILZ/4G52udMOjCBxjK5REL2/0hmn B+VPW/vK3GdjN4PoGUls3QaZzSkbaWAiBg2DGYnTmf/MfYXa31eQ7pow+ay0Pa1Qj/ MYUQF6AfSsuAXaqFwZUmUR0FNJXOvAzkxNLwGHMpYfVF1WZirIR5cZWcKdKPlBQ4O5 8hCSR3y2+gprCPrkE/8wcNFA= Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id A7DDF3389A2; Fri, 27 Dec 2024 23:19:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1735341544; bh=jcZnzcsduPSJ/S5JGMMwQy+P4SbnUFpuRAVXdy3+tSs=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=plKTK5ETZXQm6WHdAuEisTW7KuHKfe+6t5xzmU8r12VuBZj8fMPuobslWLxSv0I0v LZ25BxR1tAAZcI739IQ+fhvZpVrJd3N1BzZMOFSApMS0ytSBEVpJHRkThwke1UuGwd rSbbEw5l55M59Vw3sexOKp6VxLvbsxp5/3KiXPfW4wt7nCd2B/uxQSljwVEePceo+e v9U7M9gKKrO8MKoBjYKKm2MgVBvUCrzOccuc/Z3QXWb5qqhxnQSdzapu1VthByKlWt j15FFKEcPdgTzzLiw3ZbF4rx1GEajRnVSjZjEhwE7m8/hi9TiE0SJiUIGlmcVnSevT R3GTxw7N1qKhmIxeYr2EWZBS909KyFhH/bMFf7Eu41gv53gOLfhoNEsHyD7OxMYvzP go8FHNS8UvUMS3ZLSRUFCGUJ9xGplkvWInGG8q+UYSBLov1J9CGonuqrVjiDd1mPVO HIbVXdJ3w1QGJlnkIdOj5gPEXX9OPtHJgHSticvjDzwy6h2eEYVU26dHne2zhdvx87 59Qy6jvOu891yHerBzwrvatPS38X4Atb3ouPCzsan5o1BMN/tre3n5WQ7L3RshQvCV q865R+5ij/KP436/HtK/8jfGrHqgeKqQCv2P1bLaMc4ByGGWjUnA+AkpUb3cg1YVw7 s2Rimvt/LxLl3MatqHg/q+vc= From: Tomas Volf <~@wolfsden.cz> In-Reply-To: <87o70yzpk7.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 26 Dec 2024 11:50:00 +0100") References: <87r064ippt.fsf@gnu.org> <877c7w7bxi.fsf@wolfsden.cz> <87o70yzpk7.fsf@gnu.org> Date: Sat, 28 Dec 2024 00:19:03 +0100 Message-ID: <875xn44suw.fsf@wolfsden.cz> User-Agent: Gnus/5.13 (Gnus v5.13) 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -4.47 X-Spam-Score: -4.47 X-Migadu-Queue-Id: 8581878F95 X-TUID: ipaXmtrT1gP1 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hi! > > Tomas Volf <~@wolfsden.cz> skribis: > >> When you have another login session active when you log out and in >> again, new shepherd is *not* spawned. I am guessing here but probably >> last log out causes XDG_RUNTIME_DIR to be removed (by elogind in my >> case), so on log in there is no /run/user/$UID/on-first-login-executed, >> so it runs again and starts the shepherd. >> >> But even if that would be solved, since the runtime directory was nuked, >> there is no shepherd socket around anymore, so the (still running) >> shepherd from previous login session cannot be contacted by herd. > > Hmm, when is /run/user/UID deleted? I believe it is done by elogind (in my setup) when last user session (for the given UID) logs out. If I grepped right, it is done by user_finalize function in logind-user.c. It (AFAIUT) it should be performed when last session of the seat terminates. So if you log only into a single TTY, the XDG_RUNTIME_DIR will be removed on every log out. > >> Of the top of my head I can think of two possible solutions: >> >> 1. Stop the shepherd on log out. So as we have on-first-login, we would >> have on-last-logout. I have no idea how to implement that. Maybe we >> could use ~/.bash_logout? Or some PAM thing? > > Or some elogind thing, rather? I looked around the manual page, but did not found anything. There is KillUserProcesses, but that feels like fairly big hammer, and something that should *not* be enabled by default. We could patch elogind to add new RemoveRuntimeDirectory boolean flag to allow keeping the XDG_RUNTIME_DIR even after last log out (I personally would prefer that behavior anyway). I am not sure what our policy regarding patches here is. > > But then, how do we make it work on other distros? Maybe on systemd > distros shepherd receives SIGTERM or something, in which case it > terminates properly. No idea here. ~/.bash_logout? > >> 2. Shepherd could shutdown gracefully when the control socket is deleted >> from the file system. It is arguable how useful running shepherd is >> without the socket anyway. > > I don=E2=80=99t think that=E2=80=99s workable: you=E2=80=99d need to poll= /inotify for the > existence of that socket, but even if it exists on the file system, you > cannot tell whether it matches the socket you=E2=80=99re accepting on. For files I would suggest checking if both `stat:dev' and `stat:ino' match in order to detect whether it is the same file. Not sure if same strategy can be used for unix sockets. Tomas =2D-=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmdvNecOHH5Ad29sZnNk ZW4uY3oACgkQL7/ufbZ/wamqow/5ARGzpgBLPnkZwrBhnb2M3oaDxKJP3xCI9rwq asdXIj6IdrK2BXikuRAKq8iLdJdzZzZXNVBidTkYOu9U6OYZoQ28kzdBk0wQQ0lk rKooFzjsxGL2WVp3N9j5Z+oMT6RFLSDf9W2w3sOAp6boNzZ4iHVQKtFHmWhCFJ6e LBI+C0EFZoWoEoZzrboEMDC5r9NYRLAr2tUxu6RG+FZ+Shd4gT827oeTtvn2nMIz agfHAER2DUJcWNJy1QuPMvyOWicmFEEHk0wNiLw9xdWiodN4/qdt9AcudmHkQtY/ oASK/aBbAa74avwBPIXaGosD9djABKWIjF0JtzL0/C+YwTUDkqkx1Fp2rKYkg5oY Oko0ctMuFpyIJLIx7A8notShubi1YVDhXrKxbCo7xuSVcT1N5TJ0TVdLT6mAA5lF haDmC+7+u8Y/ZOvQQ1Z1zsBYzl3oiPspSzZ5tbIWlfQMGf35jA8onCz+ksgVh/Ps LGTHgvoIszeJ5tP9yUPB3ScPRiYiRy9GUj0sN7wZEPM41fqu+Lxm95R9RMMGPjEY EoAB/UyJP/29puD6EFHBH6CHFm2XE7U1NqIkep1UaNlipgr/JMle7EB7JbE9HZsS ifKNVwrpVV0wP85nhxkYkLz3oXAhwlq4FHPPF2mAthIcL0bZJflchdIWk2Ad8tIK OZLG6tU= =X+CU -----END PGP SIGNATURE----- --=-=-=--