From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id kNSPLgFGIGXiYgEAauVa8A:P1 (envelope-from ) for ; Fri, 06 Oct 2023 19:38:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id kNSPLgFGIGXiYgEAauVa8A (envelope-from ) for ; Fri, 06 Oct 2023 19:38:09 +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 59884515E1 for ; Fri, 6 Oct 2023 19:38:09 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=planete-kraus.eu header.s=albinoniB header.b="c Lk3H3w"; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1696613889; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: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=fEENfzbWipPm2gPLz09BaeuIhgCGhqnRsmLHP0lQoA8=; b=GRollRVSqEb9EfAmCjeeppJphfPssmhQkAdV8CmPFu13hg2LtIuIpzCGZMSjNn4bhvVkTS ReaVtkN+J37yucxuam0wtMxtfZkEGP91jpvli9XkVENVvjjWpKW+0iqPchcYmcVDrNxapw bo8arrp7Ua5UOduYFvJDADz+oz7FFK1EiTiYpIsT+1up/sVQqfy/rrju1LyQMvrN73fe/k Q0MW2FFia5y4Og5DLjXC5T7EmQ/DBfYTQDOi6ltE5ttddohdbmXNGAu7VNGolphsO197wA a3OgqZ3FDfYrNBVCsYF5Iv/7eUA0e/gbKZMNhSjr8fVVPiDUWdAT/jyrl3CCrA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=planete-kraus.eu header.s=albinoniB header.b="c Lk3H3w"; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696613889; a=rsa-sha256; cv=none; b=axB205ViKA+/YRgeYWebWX4vDzmNA00nCVUznTHp4KOoiWxfelvnlfcoJQ0jpqMI4h+ULE Kc/dhOny5O0jTxLW3Q4bXtO8oaZIPmafaL+VFF8ItyKhkQEF2e3UVID+sdjTCsoXS2QlPJ 0aRX3VA+SQAvxCHlJH8lk9qEgl6hBuKFtAXAzgUKQMcY/uE5GyGpBkKE2SM/W7wMBN4/Id FPlkppv8MsWdFdPzAVURh9jOSnMC6DEzI1ZwPq5urwt9Z3qSZAw+KcG1ybcJyHlXCz8qRU 9YtRAzKT+AuA/PlDU2yuzutRI4tVxNePCXHdDplRzicvzQUCW7G1AI/Za9uZBQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoolm-0008HO-CX; Fri, 06 Oct 2023 13:37:46 -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 1qoolk-0008HC-GS for bug-guix@gnu.org; Fri, 06 Oct 2023 13:37:44 -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 1qoolj-0007cf-JA for bug-guix@gnu.org; Fri, 06 Oct 2023 13:37:44 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qoom2-0000fe-GL for bug-guix@gnu.org; Fri, 06 Oct 2023 13:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#66339: [PATCH gnome-team v3] gnu: dbus-service: make the session available under /run/dbus Resent-From: Vivien Kraus Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 06 Oct 2023 17:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66339 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Liliana Marie Prikler ,66339@debbugs.gnu.org Cc: rg@raghavgururajan.name, maxim.cournoyer@gmail.com Received: via spool by 66339-submit@debbugs.gnu.org id=B66339.16966138292511 (code B ref 66339); Fri, 06 Oct 2023 17:38:02 +0000 Received: (at 66339) by debbugs.gnu.org; 6 Oct 2023 17:37:09 +0000 Received: from localhost ([127.0.0.1]:52591 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoolB-0000eR-4e for submit@debbugs.gnu.org; Fri, 06 Oct 2023 13:37:09 -0400 Received: from planete-kraus.eu ([89.234.140.182]:46204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qool8-0000eI-N0 for 66339@debbugs.gnu.org; Fri, 06 Oct 2023 13:37:07 -0400 Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id d92e6728; Fri, 6 Oct 2023 17:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= message-id:in-reply-to:references:from:date:subject:to:cc :mime-version; s=albinoniB; bh=gOPpwAV0BgJuoxEFxspW3MXxkZY=; b=c Lk3H3wzq9N+rSms9IXy3JT+1UFyfJmJrsu9DYJjJmyTiX0zLlLSSs7efL5N7GaEY kWr9LJdR9WIdGovfQWyymzMrwmIdNE80m9z2XGuOAyRLMTFKC/Ir5zRGgru5Po0M LY3g7JzG5nYIu3TS9ht9OjH6nRJYBMO0T3NXGKY13ChLitIcgjGqJ8cibt5dt8oy 29PpR55PEP9asFjIaYNP0k0F4a9MGHfnBIaxR00aMO6qTE3rGtnn66kUAqc6X9YK JxSH4pRDzm+elSLWZApue94Up42VnmATMSPTzC0vFDLkFP8QEPQAYJcgTpBdLzno 7ABrM3fZLWaxDNWqHZefA== Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id 8fd226be (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Fri, 6 Oct 2023 17:36:46 +0000 (UTC) Message-ID: <3b537fed577176c82c604ac9762a9c5ec2835a21.1696613607.git.vivien@planete-kraus.eu> In-Reply-To: References: Date: Wed, 4 Oct 2023 12:47:04 +0200 MIME-Version: 1.0 User-Agent: Evolution 3.46.4 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: , Reply-to: Vivien Kraus From: Vivien Kraus via Bug reports for GNU Guix 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-Queue-Id: 59884515E1 X-Migadu-Spam-Score: -0.72 X-Migadu-Scanner: mx0.migadu.com X-Spam-Score: -0.72 X-TUID: 6WwIEflSY/oI According to https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3101, glib now searches for the session bus socket in runstatedir. The dbus service must thus have its socket in /run/dbus. For interoperability with the dbus standard, /run/dbus is also symlinked to /var/run/dbus. * gnu/services/dbus.scm (dbus-activation): Symlink /run/dbus to /var/run/dbus. (%dbus-accounts): Run dbus in /run/dbus. (dbus-root-service-type): Save the pid file in /run/dbus. --- Le jeudi 05 octobre 2023 à 06:41 +0200, Liliana Marie Prikler a écrit : > > I’m still concerned about doing a symlink in the activation function. > > What if we activate a new system from an existing one? Won’t the symlink > > fail? I think we should preemptively delete /var/run/dbus and make a new > > symlink every time. But I could be wrong, maybe this is not needed. > > > > What do you think? > If we go this route, I think we should first check whether /var/run/dbus is > indeed a symlink to /run/dbus and move the existing files if not before > deleting the directory and creating the symlink. But before that, we should > try to symlink, which will fail with EEXIST if the file already exists, > regardless of whether it's a symlink – thereafter you can check the cause of > this failure through lstat. I changed my mind! I now think it is OK for the system reconfigure to fail if a different symlink already exists. Best regards, Vivien gnu/services/dbus.scm | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm index 5a0c634393..206a7bb491 100644 --- a/gnu/services/dbus.scm +++ b/gnu/services/dbus.scm @@ -163,7 +163,7 @@ (define %dbus-accounts (group "messagebus") (system? #t) (comment "D-Bus system bus user") - (home-directory "/var/run/dbus") + (home-directory "/run/dbus") (shell (file-append shadow "/sbin/nologin"))))) (define dbus-setuid-programs @@ -186,7 +186,24 @@ (define (dbus-activation config) (let ((user (getpwnam "messagebus"))) ;; This directory contains the daemon's socket so it must be ;; world-readable. - (mkdir-p/perms "/var/run/dbus" user #o755)) + (mkdir-p/perms "/run/dbus" user #o755)) + + (catch 'system-error + (lambda () + (symlink "/run/dbus" "/var/run/dbus")) + (lambda args + (let ((errno (system-error-errno args))) + (cond + ((= errno EEXIST) + (let ((existing-name + (readlink "/run/dbus"))) + (unless (equal? existing-name "/var/run/dbus") + (error "the symlink /run/dbus exists and does not point to /var/run/dbus")))) + (else + (format (current-error-port) + "Failed to symlink /run/dbus to /var/run/dbus: ~s~%" + (strerror errno)) + (error "cannot create /var/run/dbus")))))) (unless (file-exists? "/etc/machine-id") (format #t "creating /etc/machine-id...~%") @@ -210,7 +227,7 @@ (define dbus-shepherd-service '(#:environment-variables '("DBUS_VERBOSE=1") #:log-file "/var/log/dbus-daemon.log") '()) - #:pid-file "/var/run/dbus/pid")) + #:pid-file "/run/dbus/pid")) (stop #~(make-kill-destructor))))))) (define dbus-root-service-type base-commit: b18b2d13488f2a92331ccad2dc8cbb54ee15582f -- 2.41.0