From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id EJwjK0gMgmJ51wAAbAwnHQ (envelope-from ) for ; Mon, 16 May 2022 10:33:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KL0IK0gMgmI4+QAA9RJhRA (envelope-from ) for ; Mon, 16 May 2022 10:33:12 +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 3BE942AE32 for ; Mon, 16 May 2022 10:33:12 +0200 (CEST) Received: from localhost ([::1]:48876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqWAB-00016K-Cf for larch@yhetil.org; Mon, 16 May 2022 04:33:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqW4E-0004OV-KB for bug-guix@gnu.org; Mon, 16 May 2022 04:27:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nqW4E-0001Ov-AM for bug-guix@gnu.org; Mon, 16 May 2022 04:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nqW4E-0000sp-5W for bug-guix@gnu.org; Mon, 16 May 2022 04:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#55444: elogind startup race between shepherd and dbus-daemon Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 16 May 2022 08:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55444 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 55444@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16526895883348 (code B ref -1); Mon, 16 May 2022 08:27:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 May 2022 08:26:28 +0000 Received: from localhost ([127.0.0.1]:51638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqW3f-0000rv-NT for submit@debbugs.gnu.org; Mon, 16 May 2022 04:26:27 -0400 Received: from lists.gnu.org ([209.51.188.17]:50136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqW3d-0000rl-UJ for submit@debbugs.gnu.org; Mon, 16 May 2022 04:26:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqW3Z-0003vV-SB for bug-guix@gnu.org; Mon, 16 May 2022 04:26:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqW3Z-0001Gy-IR for bug-guix@gnu.org; Mon, 16 May 2022 04:26:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=Mw1l525OMdOZVRAYaJPDpoV5ekpOEhXSqqfa5J3dMGw=; b=BIl4hz1c/qP9w1 0MidSLF0MgJ7LvdyD3wLiEpELVHo2/5bZtziaqU9dng1F6BpxokdgJnJ8aFKDdaxJWpPm+FSqE6Ol B00Y6TypC0RrNE234dwT1gx4lpodmKHL0PabF2IbOlRicCj7rGQrvZ7Xl+IuZKBNq2K7kYA3hkPDO ehrFGLfh+JDK05znmVVRBRxzT1srSVPCPg01159TntOZjYWCRDHX8Z317As/ePY8ZuBEQ5MCxjYGw G9qCVM4ZX/i72HtaFdGbb/9fouXmkXclYLkw5z+o+uod4834OJ6kAeD5Kx+z72vbJjMiD8o4YpIGQ cOxP29SC43CuWwi8FaKg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:49500 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqW3V-00043I-JZ for bug-guix@gnu.org; Mon, 16 May 2022 04:26:20 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 27 =?UTF-8?Q?Flor=C3=A9al?= an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 16 May 2022 10:26:15 +0200 Message-ID: <877d6lc28o.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652689992; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Mw1l525OMdOZVRAYaJPDpoV5ekpOEhXSqqfa5J3dMGw=; b=sPaMbBgjbXcFO/ztY2sNPiDGTzZQnK1O+15LDObyGpxECu5uO+4bdqf95/sT62L56mNf9D yv73P25goUJEJyksZxyfAHUjcLy2znXmCsg7Ych7qO42kTnEqROAQRNg0rXvxXm3goPo3X BpBl3hxLVmTy4qbc2j0CeBPOxeAN2Pi5eI0F2YcJzzvicF4qu11sk100RFik6ylP2I55im ljwI/PZsaDFo21JQDSvr7Qf9lG5jsZSEAvlES0bb30eLA3QPLaqTgy7zY4Lgq1VUAsKgo+ I/GbmKSLp8jjin2XG0vZ/ciXdFdHXrhhhDqewNdI8LBf6S42V1aB3eoBLVUFmA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652689992; a=rsa-sha256; cv=none; b=KoN0nNXNA9SLELBLWryRNTdPRbNZA+1mkCYrkT86pn2pMC+NZmGxbl4K+Rhw//Lj4E9vzy tsBM8vVRYXEWT8pUvhfm3J4LUNQDuWDU0vB9gbiVTNyvVK6hFfaRCvHL1OX2aEVpqdBY0Y AcvAGeYJGZmXA5LL1ntt5L+VIEa8u1KVF3iDRyuoffbpFEL7eFIhV22n1N7OvH0j6HfP0i 4a5XO7blTBay27DUbEdyYN24QsDGxfOCXKnJ5zWzq9smxu3BZL3vBm3yvrGMbE6kGkDzcI aWeN6i3HICwt0MY7U5b23Z/MOU32oNeA9ZmaKYsJaRQ7eid058JRdEdwKoG0kQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=BIl4hz1c; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Spam-Score: -5.03 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=BIl4hz1c; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Queue-Id: 3BE942AE32 X-Spam-Score: -5.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: 8EfYVb+9+F3A Hello! Currently (40a729a0e6f1d660b942241416c1e2c567616d4d), shepherd and dbus-daemon compete to start elogind: shepherd tries to start it eagerly, and dbus-daemon starts it on-demand upon bus activation. Sometimes dbus-daemon wins, and thus shepherd tries a few times to start it anyway, leading to the infamous: elogind is already running as PID 123 (elogind checks whether its PID file exists. Note that you may see that message also when shepherd wins, because dbus-daemon tries to start it anyway.) Eventually, shepherd considers that elogind cannot be started and disables it. In addition to being ridiculous, it=E2=80=99s harmful: the =E2=80=98xorg-se= rver=E2=80=99 service (from =E2=80=98gdm-service-type=E2=80=99 and =E2=80=98sddm-service-type=E2= =80=99 depends on =E2=80=98elogind=E2=80=99), so if shepherd loses the race, Xorg isn=E2=80=99t started (on my laptop, shepherd never loses the race it seems, but i=E2=80=99ve seen it lose half = of the time on a slower machine). The reason elogind is started by shepherd is explained in this comment: ;; Start elogind from the Shepherd rather than waiting ;; for bus activation. This ensures that it can handle ;; events like lid close, etc. This comes from 94a881178af9a9a918ce6de55641daa245c92e73, which was a fix for . I believe the justification still holds. So it would seem that the solution to this is to prevent dbus-daemon from starting elogind. We can do that by changing org.freedesktop.login1.service so that it has =E2=80=9CExec=3Dtrue=E2=80=9D= instead of =E2=80=9CExec=3Delogind --daemon=E2=80=9D. =E2=80=9CExec=3Dtrue=E2=80=9D is a bit crude because it doesn=E2=80=99t gua= rantee that elogind is really started; if that isn=E2=80=99t good enough, we could instead wait fo= r the PID file or something (as of Shepherd 0.9.0, invoking =E2=80=98herd start elogind=E2=80=99 potentially leads shepherd to start a second instance if t= he first one is still being started, so we can=E2=80=99t really do that). Depending on what we end up with, we might also revisit whether xorg-server needs to explicitly depend on elogind. Thoughts? Ludo=E2=80=99.