GNU bug report logs -
#66339
Gnome-team dbus socket in /var/run/dbus, not /run/dbus
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 66339 in the body.
You can then email your comments to 66339 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-guix <at> gnu.org
:
bug#66339
; Package
guix
.
(Wed, 04 Oct 2023 12:53:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Vivien Kraus <vivien.kraus <at> univ-reims.fr>
:
New bug report received and forwarded. Copy sent to
bug-guix <at> gnu.org
.
(Wed, 04 Oct 2023 12:53:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Dear guix,
The gnome-team branch starts the dbus service to provide a system
session socket in /var/run/dbus, but the dbus client expects it in
/run/dbus. This is the case for gdm and upowerd, and possibly many
more.
If I add
(symlink "/var/run/dbus" "/run/dbus")
in the script provided by dbus-activation (gnu/services/dbus.scm), then
gdm starts, and I can log in (with XFCE, GNOME still can’t load) and
verify upowerd works.
I don’t think this is a good solution though. I think we need to dig
into how to bind the socket in /run/dbus, and check the dbus clients to
make sure they all expect the socket in /run/dbus.
Best regards,
Vivien
Information forwarded
to
bug-guix <at> gnu.org
:
bug#66339
; Package
guix
.
(Wed, 04 Oct 2023 16:56:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 66339 <at> debbugs.gnu.org (full text, mbox):
* 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")
(unless (file-exists? "/etc/machine-id")
(format #t "creating /etc/machine-id...~%")
base-commit: b18b2d13488f2a92331ccad2dc8cbb54ee15582f
--
2.41.0
Information forwarded
to
bug-guix <at> gnu.org
:
bug#66339
; Package
guix
.
(Wed, 04 Oct 2023 18:32:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 66339 <at> debbugs.gnu.org (full text, mbox):
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
Information forwarded
to
bug-guix <at> gnu.org
:
bug#66339
; Package
guix
.
(Wed, 04 Oct 2023 21:55:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 66339 <at> debbugs.gnu.org (full text, mbox):
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
Information forwarded
to
bug-guix <at> gnu.org
:
bug#66339
; Package
guix
.
(Thu, 05 Oct 2023 04:43:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 66339 <at> debbugs.gnu.org (full text, mbox):
Am Mittwoch, dem 04.10.2023 um 12:47 +0200 schrieb Vivien Kraus:
> 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?
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.
> 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"))
This assumes "/var/run/dbus" to be a regular file or symlink, which
it's not on reconfiguration IIUC.
> + (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
Cheers
Information forwarded
to
bug-guix <at> gnu.org
:
bug#66339
; Package
guix
.
(Fri, 06 Oct 2023 17:38:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 66339 <at> debbugs.gnu.org (full text, mbox):
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
Information forwarded
to
bug-guix <at> gnu.org
:
bug#66339
; Package
guix
.
(Fri, 06 Oct 2023 18:52:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 66339 <at> debbugs.gnu.org (full text, mbox):
Am Mittwoch, dem 04.10.2023 um 12:47 +0200 schrieb Vivien Kraus:
> 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.
Perhaps, but it's not okay to fail if it's a regular directory. We
should move those!
Cheers
Information forwarded
to
bug-guix <at> gnu.org
:
bug#66339
; Package
guix
.
(Fri, 06 Oct 2023 20:06:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 66339 <at> debbugs.gnu.org (full text, mbox):
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.
---
> Perhaps, but it's not okay to fail if it's a regular directory. We should
> move those!
I’m not sure I understand. What comes to my mind is:
1. Try to make the symlink. If it fails with EEXIST:
2. Try to read /var/run/dbus as a symlink. If it points to /run/dbus already,
stop. Otherwise:
3. Move everything in /var/run/dbus to /run/dbus.
4. Delete the now-empty /var/run/dbus.
5. Symlink /run/dbus to /var/run/dbus.
Is it what you meant?
Best regards,
Vivien
gnu/services/dbus.scm | 38 +++++++++++++++++++++++++++++++++++---
1 file changed, 35 insertions(+), 3 deletions(-)
diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm
index 5a0c634393..44bf0c910b 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,39 @@ (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
+ (false-if-exception
+ (readlink "/var/run/dbus"))))
+ (unless (equal? existing-name "/run/dbus")
+ ;; Move the content of /var/run/dbus to /run/dbus, and
+ ;; retry.
+ (let ((dir (opendir "/var/run/dbus")))
+ (let move-to-/run/dbus ()
+ (let ((next (readdir dir)))
+ (unless (or (equal? next ".")
+ (equal? next "..")
+ (eof-object? next))
+ (rename-file (string-append "/var/run/dbus/" next)
+ (string-append "/run/dbus/" next)))
+ (unless (eof-object? next)
+ (move-to-/run/dbus))))
+ (closedir dir)
+ (rmdir "/var/run/dbus")
+ (symlink "/run/dbus" "/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 +242,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
Information forwarded
to
bug-guix <at> gnu.org
:
bug#66339
; Package
guix
.
(Fri, 06 Oct 2023 21:42:01 GMT)
Full text and
rfc822 format available.
Message #29 received at 66339 <at> debbugs.gnu.org (full text, mbox):
Am Mittwoch, dem 04.10.2023 um 12:47 +0200 schrieb Vivien Kraus:
> 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.
> ---
>
> > Perhaps, but it's not okay to fail if it's a regular directory. We
> > should
> > move those!
>
> I’m not sure I understand. What comes to my mind is:
>
> 1. Try to make the symlink. If it fails with EEXIST:
> 2. Try to read /var/run/dbus as a symlink. If it points to /run/dbus
> already,
> stop. Otherwise:
> 3. Move everything in /var/run/dbus to /run/dbus.
> 4. Delete the now-empty /var/run/dbus.
> 5. Symlink /run/dbus to /var/run/dbus.
>
> Is it what you meant?
Yep, that's what I meant.
> Best regards,
>
> Vivien
>
> gnu/services/dbus.scm | 38 +++++++++++++++++++++++++++++++++++---
> 1 file changed, 35 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm
> index 5a0c634393..44bf0c910b 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,39 @@ (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
> + (false-if-exception
> + (readlink "/var/run/dbus"))))
> + (unless (equal? existing-name "/run/dbus")
> + ;; Move the content of /var/run/dbus to
> /run/dbus, and
> + ;; retry.
> + (let ((dir (opendir "/var/run/dbus")))
> + (let move-to-/run/dbus ()
> + (let ((next (readdir dir)))
> + (unless (or (equal? next ".")
> + (equal? next "..")
> + (eof-object? next))
> + (rename-file (string-append
> "/var/run/dbus/" next)
> + (string-append "/run/dbus/"
> next)))
> + (unless (eof-object? next)
> + (move-to-/run/dbus))))
> + (closedir dir)
> + (rmdir "/var/run/dbus")
> + (symlink "/run/dbus" "/var/run/dbus")))))
You might want to express this in terms of a function similar to copy-
recursively, or at the very least a let loop.
(let loop ((next (readdir dir)))
(cond
((eof-object? next) (closedir dir))
((member next "." "..") (loop (readdir dir)))
(else (rename-file …) (loop (readdir dir)))))
> + (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 +242,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
Cheers
Information forwarded
to
bug-guix <at> gnu.org
:
bug#66339
; Package
guix
.
(Sat, 07 Oct 2023 14:25:02 GMT)
Full text and
rfc822 format available.
Message #32 received at 66339 <at> debbugs.gnu.org (full text, mbox):
Glib has made /run the default runstatedir:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3101
However, in Guix, the default runstatedir is /var/run.
* gnu/packages/glib.scm (glib): Set runtime_dir to /var/run.
---
I changed my mind again! Following the IRC discussion, Guix has a separate
/var/run and /run (and puts /run/current-system/ in /run). So, /var/run/dbus
is actually the correct place to put the system session socket.
gnu/packages/glib.scm | 1 +
1 file changed, 1 insertion(+)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 8af89d60e0..c4fcc20bb6 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -254,6 +254,7 @@ (define glib
#:configure-flags #~(list "--default-library=both"
"-Dman=false"
"-Dselinux=disabled"
+ "-Druntime_dir=/var/run"
(string-append "--bindir="
#$output:bin "/bin"))
#:phases
base-commit: b18b2d13488f2a92331ccad2dc8cbb54ee15582f
--
2.41.0
Information forwarded
to
bug-guix <at> gnu.org
:
bug#66339
; Package
guix
.
(Sat, 07 Oct 2023 14:41:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 66339 <at> debbugs.gnu.org (full text, mbox):
Hi,
Vivien Kraus <vivien <at> planete-kraus.eu> writes:
> Glib has made /run the default runstatedir:
>
> https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3101
>
> However, in Guix, the default runstatedir is /var/run.
>
> * gnu/packages/glib.scm (glib): Set runtime_dir to /var/run.
> ---
>
> I changed my mind again! Following the IRC discussion, Guix has a separate
> /var/run and /run (and puts /run/current-system/ in /run). So, /var/run/dbus
> is actually the correct place to put the system session socket.
I don't follow; why does it matter that Guix puts its current-system
directory under /run? /run is to be shared by many applications, like
/tmp, no?
I still see /var/run as the legacy directory of /run, so I'd prefer we
standardize to use the modern variant to reduce this kind of friction
with the applications which will only grow in the future.
--
Thanks,
Maxim
Information forwarded
to
bug-guix <at> gnu.org
:
bug#66339
; Package
guix
.
(Sun, 08 Oct 2023 13:16:01 GMT)
Full text and
rfc822 format available.
Message #38 received at 66339 <at> debbugs.gnu.org (full text, mbox):
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.
---
Hello,
I changed my mind back to a previous mind change, so: the socket should be
installed in /run. I believe that the code moves the content of the existing
/var/run/dbus to /run/dbus before trying the symlink again, if /var/run/dbus
exists and is not a symlink to /run/dbus. I don’t really have a way to check
the interesting case where existing files need to be moved. However, the
gnome-team-configured VM works.
Best regards,
Vivien
gnu/services/dbus.scm | 39 ++++++++++++++++++++++++++++++++++++---
1 file changed, 36 insertions(+), 3 deletions(-)
diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm
index 5a0c634393..aa9ce0720c 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,40 @@ (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
+ (false-if-exception
+ (readlink "/var/run/dbus"))))
+ (unless (equal? existing-name "/run/dbus")
+ ;; Move the content of /var/run/dbus to /run/dbus, and
+ ;; retry.
+ (let ((dir (opendir "/var/run/dbus")))
+ (let move-to-/run/dbus ((next (readdir dir)))
+ (cond
+ ((eof-object? next)
+ (closedir dir))
+ ((member next '("." ".."))
+ (move-to-/run/dbus (readdir dir)))
+ (else
+ (begin
+ (rename-file (string-append "/var/run/dbus/" next)
+ (string-append "/run/dbus/" next))
+ (move-to-/run/dbus (readdir dir))))))))
+ (rmdir "/var/run/dbus")
+ (symlink "/run/dbus" "/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 +243,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
Information forwarded
to
bug-guix <at> gnu.org
:
bug#66339
; Package
guix
.
(Sun, 08 Oct 2023 14:54:01 GMT)
Full text and
rfc822 format available.
Message #41 received at 66339 <at> debbugs.gnu.org (full text, mbox):
Am Mittwoch, dem 04.10.2023 um 12:47 +0200 schrieb Vivien Kraus:
> 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.
> ---
>
> Hello,
>
> I changed my mind back to a previous mind change, so: the socket
> should be
> installed in /run. I believe that the code moves the content of the
> existing
> /var/run/dbus to /run/dbus before trying the symlink again, if
> /var/run/dbus
> exists and is not a symlink to /run/dbus. I don’t really have a way
> to check
> the interesting case where existing files need to be moved. However,
> the
> gnome-team-configured VM works.
>
> Best regards,
>
> Vivien
>
> gnu/services/dbus.scm | 39 ++++++++++++++++++++++++++++++++++++---
> 1 file changed, 36 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm
> index 5a0c634393..aa9ce0720c 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,40 @@ (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
> + (false-if-exception
> + (readlink "/var/run/dbus"))))
> + (unless (equal? existing-name "/run/dbus")
> + ;; Move the content of /var/run/dbus to
> /run/dbus, and
> + ;; retry.
> + (let ((dir (opendir "/var/run/dbus")))
> + (let move-to-/run/dbus ((next (readdir dir)))
> + (cond
> + ((eof-object? next)
> + (closedir dir))
> + ((member next '("." ".."))
> + (move-to-/run/dbus (readdir dir)))
> + (else
> + (begin
> + (rename-file (string-append
> "/var/run/dbus/" next)
> + (string-append "/run/dbus/"
> next))
> + (move-to-/run/dbus (readdir dir))))))))
I'd rename "move-to-/run/dbus" to the boring but more idiomatic "loop".
This saves us some horizontal real-estate that'd allow us to squash
some lines.
> + (rmdir "/var/run/dbus")
> + (symlink "/run/dbus" "/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 +243,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
Otherwise LGTM. I'd commit it, but my machine is currently busy
building half of core-updates for no reason.
Cheers
Information forwarded
to
bug-guix <at> gnu.org
:
bug#66339
; Package
guix
.
(Sun, 08 Oct 2023 15:42:01 GMT)
Full text and
rfc822 format available.
Message #44 received at 66339 <at> debbugs.gnu.org (full text, mbox):
Hi,
On 2023-10-07 15:39, Maxim Cournoyer wrote:
> Hi,
>
> Vivien Kraus <vivien <at> planete-kraus.eu> writes:
>
>> Glib has made /run the default runstatedir:
>>
>> https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3101
>>
>> However, in Guix, the default runstatedir is /var/run.
>>
>> * gnu/packages/glib.scm (glib): Set runtime_dir to /var/run.
>> ---
>>
>> I changed my mind again! Following the IRC discussion, Guix has a separate
>> /var/run and /run (and puts /run/current-system/ in /run). So, /var/run/dbus
>> is actually the correct place to put the system session socket.
I recommend consulting the dbus spec [1] (System message bus subsection).
If I understood it correctly, `/var/run/dbus' is correct when the environment
variable DBUS_SYSTEM_BUS_ADDRESS is not set.
The /var/run/dbus or /run/dbus confusion is clarified in the third paragraph:
“On systems where /var/run/ is known to be synonymous with /run/ (such as most Linux
operating system distributions), implementations might prefer to make use of that knowledge
to connect to or listen on unix:path=/run/dbus/system_bus_socket instead, […]”
So it's up for the dbus implementation to detect whether /var/run/ is a symlink
to /run and whether it wants to explicitly choose /run if that's the case though
none of this is mandatory.
[…]
> I still see /var/run as the legacy directory of /run, so I'd prefer we
> standardize to use the modern variant to reduce this kind of friction
> with the applications which will only grow in the future.
My understanding is that the implementation should be placing them under
/var/run/dbus but this is orthogonal to the value of runstatedir.
In view with [2] I think runstatedir should be /run and Guix should be
modernized to have /var/run symlinked to /run.
[1]: <https://dbus.freedesktop.org/doc/dbus-specification.html>
[2]: <https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s13.html>
--
Furthermore, I consider that nonfree software must be eradicated.
Cheers,
Bruno.
Reply sent
to
Liliana Marie Prikler <liliana.prikler <at> gmail.com>
:
You have taken responsibility.
(Mon, 09 Oct 2023 20:38:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Vivien Kraus <vivien.kraus <at> univ-reims.fr>
:
bug acknowledged by developer.
(Mon, 09 Oct 2023 20:38:02 GMT)
Full text and
rfc822 format available.
Message #49 received at 66339-done <at> debbugs.gnu.org (full text, mbox):
Am Sonntag, dem 08.10.2023 um 16:53 +0200 schrieb Liliana Marie
Prikler:
> [...]
> Otherwise LGTM. I'd commit it, but my machine is currently busy
> building half of core-updates for no reason.
No longer busy, time to commit.
Thanks
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 07 Nov 2023 12:24:09 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 283 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.