[Bug 279743] devel/dbus: move session bus socket under XDG_RUNTIME_DIR

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 15 Jun 2024 03:00:40 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279743

            Bug ID: 279743
           Summary: devel/dbus: move session bus socket under
                    XDG_RUNTIME_DIR
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: desktop@FreeBSD.org
          Reporter: jbeich@FreeBSD.org
                CC: manu@freebsd.org
          Assignee: desktop@FreeBSD.org
             Flags: maintainer-feedback?(desktop@FreeBSD.org)

Created attachment 251459
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=251459&action=edit
v1 (apply via "git am")

FreeBSD 14.1 added pam_xdg(8) to ensure XDG_RUNTIME_DIR is always defined.
Instead of littering /tmp with many randomly-named DBus sockets use
XDG_RUNTIME_DIR with non-random socket name. The directory is guaranteed to be
cleaned up on user logout or reside on tmpfs(5) thus cleaned up on reboot.
Also, better matches Linux with systemd.

DBus already uses XDG_RUNTIME_DIR to read service activation files from:

$ XDG_RUNTIME_DIR=$(mktemp -dt xdg-run) dbus-run-session sh
$ find /tmp/xdg-run.*
/tmp/xdg-run.mKuM3gZ7
/tmp/xdg-run.mKuM3gZ7/dbus-1
/tmp/xdg-run.mKuM3gZ7/dbus-1/services

Note, don't confuse with system bus aka dbus_enable=YES in /etc/rc.conf which
still uses /var/run/dbus/system_bus_socket.

-- 
You are receiving this mail because:
You are the assignee for the bug.