all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vivien Kraus via Bug reports for GNU Guix <bug-guix@gnu.org>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>, 66339@debbugs.gnu.org
Cc: rg@raghavgururajan.name, maxim.cournoyer@gmail.com
Subject: bug#66339: [PATCH gnome-team v2] gnu: dbus-service: make the session available under /run/dbus
Date: Wed, 4 Oct 2023 12:47:04 +0200	[thread overview]
Message-ID: <751681ee8d9123e869111a11ce1446d9156117da.1696456123.git.vivien@planete-kraus.eu> (raw)
In-Reply-To: <479a5d9dda7ac8bb26589f755e4caf3a820325a6.camel@gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3857 bytes --]

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 mercredi 04 octobre 2023 à 20:30 +0200, Liliana Marie Prikler a écrit :
> Am Mittwoch, dem 04.10.2023 um 12:47 +0200 schrieb Vivien Kraus:
> > * gnu/services/dbus.scm (dbus-activation): Symlink /var/run/dbus to
> > /run/dbus.
> > ---
> >  gnu/services/dbus.scm | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm
> > index 5a0c634393..80968ac1a4 100644
> > --- a/gnu/services/dbus.scm
> > +++ b/gnu/services/dbus.scm
> > @@ -187,6 +187,7 @@ (define (dbus-activation config)
> >            ;; This directory contains the daemon's socket so it
> > must
> > be
> >            ;; world-readable.
> >            (mkdir-p/perms "/var/run/dbus" user #o755))
> > +        (symlink "/var/run/dbus" "/run/dbus")
> From [1]:
> > As documented in the NEWS file in
> > https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/209, it’s
> > only valid to use /run – rather than /var/run – for D-Bus if the
> > two
> > paths are interoperable. i.e. /var/run should be a symlink to /run,
> > and the D-Bus daemon should be configured to put its socket there.
>
> Thus, the order of the two ought to be reversed.  Alternatively, we
> could add '-Druntime_dir=/var/run' to glib.  WDYT?
> 
> [1]: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3101

Thank you for finding this information. I think we should follow glib, and
have the socket in /run/dbus, with the symlink for standard interoperability.

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?

Best regards,

Vivien

 gnu/services/dbus.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm
index 5a0c634393..53efa7adea 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,11 @@ (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))
+
+        (when (file-exists? "/var/run/dbus")
+          (delete-file "/var/run/dbus"))
+        (symlink "/run/dbus" "/var/run/dbus")
 
         (unless (file-exists? "/etc/machine-id")
           (format #t "creating /etc/machine-id...~%")
@@ -210,7 +214,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




  reply	other threads:[~2023-10-04 21:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3121a39dc569ff872afe74a8871ef71456ea5451.camel@univ-reims.fr>
2023-10-04 10:47 ` bug#66339: [WIP PATCH gnome-team] gnu: dbus-service: make the session available under /run/dbus Vivien Kraus via Bug reports for GNU Guix
2023-10-04 18:30   ` Liliana Marie Prikler
2023-10-04 10:47     ` Vivien Kraus via Bug reports for GNU Guix [this message]
2023-10-05  4:41       ` bug#66339: [PATCH gnome-team v2] " Liliana Marie Prikler
2023-10-04 10:47         ` bug#66339: [PATCH gnome-team v3] " Vivien Kraus via Bug reports for GNU Guix
2023-10-06 18:50           ` Liliana Marie Prikler
2023-10-04 10:47             ` bug#66339: [PATCH gnome-team v4] " Vivien Kraus via Bug reports for GNU Guix
2023-10-06 21:41               ` Liliana Marie Prikler
2023-10-04 10:47                 ` bug#66339: [PATCH gnome-team v6] " Vivien Kraus via Bug reports for GNU Guix
2023-10-08 14:53                   ` Liliana Marie Prikler
2023-10-09 20:36                     ` Liliana Marie Prikler
2023-10-06 21:12                 ` bug#66339: [PATCH gnome-team v5] gnu: glib: Set runstatedir Vivien Kraus via Bug reports for GNU Guix
2023-10-07 14:39                   ` bug#66339: Gnome-team dbus socket in /var/run/dbus, not /run/dbus Maxim Cournoyer
2023-10-08 15:40                     ` Bruno Victal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=751681ee8d9123e869111a11ce1446d9156117da.1696456123.git.vivien@planete-kraus.eu \
    --to=bug-guix@gnu.org \
    --cc=66339@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    --cc=maxim.cournoyer@gmail.com \
    --cc=rg@raghavgururajan.name \
    --cc=vivien@planete-kraus.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.