Subject: dbus-x11: Several processes in Plasma session including krunner have / as current working directory

From: Martin Steigerwald <[email-masked]>
Date: Sun, 05 Mar 2023 09:59:35 +0100

Package: dbus-x11
Version: 1.14.6-1devuan1
Severity: normal
X-Debbugs-Cc: [email-masked]

Dear Maintainer,

I also reported this to Debian as https://bugs.debian.org/1032368

What follows is the text I sent to Debian BTS:

Like this:

…proc# ls -ld $(pidof krunner)/cwd
lrwxrwxrwx 1 USER USER 0 10. Feb 14:26 15116/cwd -> /
…proc# ls -ld $(pidof plasmashell)/cwd
lrwxrwxrwx 1 USER USER 0 10. Feb 14:27 9191/cwd -> /home/USER

This is with /bin/sh pointing to Dash, the user shell is Z-Shell, but I 
have also seen this on systems where the user shell is Bash.

According to pstree krunner's parent process is runit which of course 
has current working directory pointing to /.

Plasmashell instead is going like this

├─runsv(2066)─┬─sddm(2116)─┬

─sddm-helper(8989)───startplasma-x11(8994)─┬─plasma_session(9056)─┬

This is reported with KDE as:

krunner starts applications with cwd "/" with init system other than 
systemd (openrc, runit, ...)

https://bugs.kde.org/432975

This is with Devuan Ceres with Runit and Elogind. I am reporting this
with Debian as well, cause I think it is an issue in Debian as well and
Debian users with other init systems can benefit from a solution. In case
you are not willing to look into this issue please tell, so another
solution or workaround can be found. I will also report this in Devuan.

Using X11 still. With Wayland this issue does not happen. But there are
too many other issues with Wayland still.

Without

% cat /usr/share/dbus-1/services/org.kde.krunner.service
[D-BUS Service]
Name=org.kde.krunner
Exec=/usr/bin/krunner
SystemdService=plasma-krunner.service

(file is from package plasma-workspace)

KRunner is not started at all.

Also I can at least confirm that the current working directory of 
kwalletd 
and kiod5 is also /. I bet those are started by the corresponding 
service files in /usr/share/dbus-1/services.

So it appears to me that this has something do to with how dbus-x11 is 
handling
DBUS services. What also points at this that the issue does not happen 
with a Wayland
session.

For Systemd based systems Plasma uses Systemd service files for startup, 
so
dbus-x11 is not involved.

Thanks,
Martin

-- System Information:
Distributor ID:	Devuan
Description:	Devuan GNU/Linux 5 (daedalus/ceres)
Release:	5
Codename:	daedalus ceres
Architecture: x86_64

Kernel: Linux 6.2.2-x64v3-xanmod1 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), 
LANGUAGE=de
Shell: /bin/sh linked to /bin/dash
Init: runit (via /run/runit.stopit)
LSM: AppArmor: enabled

Versions of packages dbus-x11 depends on:
ii  dbus-bin                 1.14.6-1devuan1
ii  dbus-daemon              1.14.6-1devuan1
ii  dbus-session-bus-common  1.14.6-1devuan1
ii  libc6                    2.36-8
ii  libdbus-1-3              1.14.6-1devuan1
ii  libx11-6                 2:1.8.4-2

dbus-x11 recommends no packages.

dbus-x11 suggests no packages.

-- debconf-show failed
-- 
Martin