Bug 476534 - Overriding D-Bus services does not work automatically using install-sessions.sh
Summary: Overriding D-Bus services does not work automatically using install-sessions.sh
Status: RESOLVED DUPLICATE of bug 462824
Alias: None
Product: kdesrc-build
Classification: Developer tools
Component: general (show other bugs)
Version: Git
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-11-04 07:30 UTC by Prajna Sariputra
Modified: 2023-11-09 22:01 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Prajna Sariputra 2023-11-04 07:30:07 UTC
SUMMARY
In the upstream dbus-daemon session.conf file [1], `<standard_session_servicedirs />` is placed above all of the `<includedir>session.d</includedir>` type stuff, so the `<servicedir>/opt/kde-dbus-scripts/services</servicedir>` part that is added by `install-sessions.sh` will be below the standard (system and user) directories. This means that for a system that has KDE Plasma installed both through the distro as well as kdesrc-build dbus-daemon will pick the version installed through the distro rather than the one provided by kdesrc-build, as per the documentation [2].

In my case this is a problem when trying to logout/shutdown/reboot with the log out greeter/screen enabled in a Plasma 6 session from kdesrc-build alongside Plasma 5.27.9 from the Arch repos, since DBus will load the Qt5 version of the greeter from the repos but with the QML2_IMPORT_PATH environment variables and such set so that it tries to load the Qt6/KF6 versions of things instead (specifically it failed at loading `~/kde/usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/logout/Logout.qml`).

To work around the logout greeter problem I copied the `org.kde.LogoutPrompt.service` file to `.local/share/dbus-1/services/`, that makes the greeter in the Plasma 6 session work.

[1]: https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/bus/session.conf.in
[2]: https://dbus.freedesktop.org/doc/dbus-daemon.1.html

STEPS TO REPRODUCE
1. Compile and install a Plasma 6 session via kdesrc-build
2. Login into the new session
3. Try to logout/reboot/shutdown with the logout screen/greeter enabled

OBSERVED RESULT
The screen just blurs, but no buttons or anything else appear.

EXPECTED RESULT
The options to logout, reboot, shutdown and so on should appear.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.240.0
Qt Version: 6.6.0
Kernel Version: 6.5.9-arch2-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 6800H with Radeon Graphics
Memory: 30.6 GiB of RAM
Graphics Processor: AMD Radeon Graphics

ADDITIONAL INFORMATION
kdesrc-build is at commit 883ab6c750f8899af570d5b805d9493d451d501c when I downloaded it.
Comment 1 Nate Graham 2023-11-08 21:24:08 UTC
*** This bug has been marked as a duplicate of bug 462824 ***
Comment 2 Nate Graham 2023-11-08 21:27:00 UTC
You seem extremely knowledgeable about this; are you aware of a way for us to override the system DBus stuff in a better way? Currently our hope is to merge https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1715 which will fix the issue in a different way, but that may be a long way off.
Comment 3 Prajna Sariputra 2023-11-09 01:04:59 UTC
I wonder if upstream could be convinced to change the defaults to also allow the additional config files to add service directories above the standard ones, especially for the session bus given that anything malicious can just drop stuff in ~/.local/share/dbus-1/services without needing any special privileges like what I'm doing already. They do clearly intend for the local config files to be able to override the defaults anyway, so I guess it's possible that they just didn't think of our use case when they wrote those defaults.

On the other hand, the default system bus service directories are all under /usr or /lib, which would be protected for immutable systems, so getting upstream to allow us to override those would probably be more of an uphill battle, and if that isn't resolved then we'd still need a proper solution like that MR you linked.

But then again, if just fixing the problem for the session bus/services would be an improvement Jade seems to have another possible solution, which is to run the D-Bus session instance with a special config file that includes but also overrides the system defaults, including the directories problem.
Comment 4 Nate Graham 2023-11-09 22:01:10 UTC
Any chance you could post that comment in the parent bug report--and even better, see if upstream might be open to the idea?

Any ideas or fixes we can implement ourselves would also be welcome.