Devuan bug report logs - #745
dbus-x11: Several processes in Plasma session including krunner have / as current working directory

Package: dbus-x11; Reported by: Martin Steigerwald <[email protected]>; Keywords: patch upstream; Forwarded to https://gitlab.freedesktop.org/dbus/dbus/-/issues/214; Maintainer for dbus-x11 is Devuan Maintainers <[email protected]>.

Message received at [email protected]:


Received: (at 745) by bugs.devuan.org; 7 Mar 2023 19:22:34 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from email.devuan.org [2001:41d0:2:d06e::5c4:2612]
	by doc.devuan.org with IMAP (fetchmail-6.4.16)
	for <debbugs@localhost> (single-drop); Tue, 07 Mar 2023 19:22:34 +0000 (UTC)
Received: from email.devuan.org
	by email.devuan.org with LMTP
	id tDe9A6SOB2TQewAAmSBk0A
	(envelope-from <[email protected]>)
	for <[email protected]>; Tue, 07 Mar 2023 19:21:08 +0000
Received: by email.devuan.org (Postfix, from userid 109)
	id E259C96F; Tue,  7 Mar 2023 19:21:07 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on email.devuan.org
X-Spam-Level: *
X-Spam-Status: No, score=1.0 required=5.0 tests=KHOP_HELO_FCRDNS,SPF_NONE
	autolearn=no autolearn_force=no version=3.4.6
Received-SPF: None (mailfrom) identity=mailfrom; client-ip=194.150.191.11; helo=mail.lichtvoll.de; [email protected]; receiver=<UNKNOWN> 
Received: from mail.lichtvoll.de (luna.lichtvoll.de [194.150.191.11])
	by email.devuan.org (Postfix) with ESMTPS id 965D28CF
	for <[email protected]>; Tue,  7 Mar 2023 19:21:02 +0000 (UTC)
Received: from 127.0.0.1 (localhost [127.0.0.1])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384)
	(No client certificate requested)
	by mail.lichtvoll.de (Postfix) with ESMTPSA id 04779615EEF;
	Tue,  7 Mar 2023 20:20:57 +0100 (CET)
From: Martin Steigerwald <[email protected]>
To: Simon McVittie <[email protected]>, Mark Hindley <[email protected]>
Cc: [email protected], [email protected]
Subject:
 Re: bug#745: dbus-x11: Several processes in Plasma session including krunner
 have / as current working directory
Date: Tue, 07 Mar 2023 20:20:57 +0100
Message-ID: <[email protected]>
In-Reply-To: <[email protected]>
References:
 <[email protected]>
 <ZAYF3q/[email protected]>
 <[email protected]>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
Authentication-Results: mail.lichtvoll.de;
	auth=pass smtp.auth=martin [email protected]

Mark Hindley - 06.03.23, 17:22:12 CET:
> On Mon, Mar 06, 2023 at 03:25:18PM +0000, Simon McVittie wrote:
> > What I absolutely don't want is to make the change, and then 2 years
> > later get hate mail from someone telling me that I've broken their
> > system by making dbus-launch prevent /home from being unmounted and
> > "why can't you just" add an option to use daemon(3).
>=20
> I think that is a very good point.

I have thought about this some more and the following question came up:=20
Why would dbus-launch with $HOME as current working directory prevent=20
from unmounting /home any more than any other process that runs with a=20
user session? At least with desktop environments like Plasma and GNOME=20
there is a ton of other processes blocking unmounting /home. It could be=20
with a very limited environment like with a tiling window manager that=20
nothing else would be using $HOME as working directory, but that must be=20
a very limited environment then, I'd say. Anyway: There will be no hate=20
mail from me. Promised.

I did some more testing which in the end is just a confirmation of what I=20
could have known already from the previous discussion. While I did not=20
confirm the PID of the dbus-launch process started by the "75dbus_dbus-
launch" script it also pretty much confirms that the session DBUS is=20
started by that script.

I added

date >/tmp/dbus-launch-started
echo $HOME >/tmp/dbus-launch-home
pwd >/tmp/dbus-launch-pwd

to "/etc/X11/Xsession.d/75dbus_dbus-launch" and

date >/tmp/dbus-update-env-started
echo $HOME >/tmp/dbus-update-env-home
pwd >/tmp/dbus-update-env-pwd

to "/etc/X11/Xsession.d/95dbus_update-activation-env".

And got this:

% grep . /tmp/dbus-launch-*
/tmp/dbus-launch-home:/home/martin
/tmp/dbus-launch-pwd:/home/martin
/tmp/dbus-launch-started:Di 7. M=C3=A4r 18:02:12 CET 2023

% grep . /tmp/dbus-update-env-*
/tmp/dbus-update-env-home:/home/martin
/tmp/dbus-update-env-pwd:/home/martin
/tmp/dbus-update-env-started:Di 7. M=C3=A4r 18:02:12 CET 2023

So both are started and both have the right working directory and $HOME=20
set to the user starting the X session.

So it is really that chdir("/") in dbus-launch=C2=B9 that causes the issue =
at=20
hand and thus there is no way to globally work-around the issue I=20
reported, at least not short of recompiling dbus-launch without that=20
chdir in place. Actually that is the result that was to be expected. But=20
now I confirmed it. I'd wonder that anyone who would really like to have=20
the option to have "dbus-launch" as started by "75dbus_dbus-launch"=20
having "/" as current working directory could just change the script,=20
given the chdir("/") would be patched out of dbus-launch.

[1] https://gitlab.freedesktop.org/dbus/dbus/-/issues/214

Interestingly in "/etc/X11/Xsession.d/95dbus_update-activation-env"=20
there is:

  # Note that anything that is D-Bus-activated between here and
  # 95dbus_update-activation-env will not have the complete environment
  # set up by Xsession.d, unless the Xsession.d snippet that sets the
  # environment variable also calls dbus-update-activation-environment.
  # See <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D815503>

but there are only "90gpg-agent" and "90x11-common_ssh-agent" between=20
it. So it seems to be whatever "95dbus_update-activation-env" is doing=20
does not including telling dbus-launch to switch working directory to=20
$HOME. But at least with anything started through krunner $HOME is set=20
correctly to the users home directory.

> KDE is the only area where I have heard of this causing problems and I
> am not aware of any other reports that seem to have the same
> underlying cause. I am not convinced there *is* a consensus for
> change and the risk of changing the default for all users of legacy
> DBus activation seems high.
>=20
> Martin, I still think this is for KDE to address if it is important to
> them. I don't think I would push to change the behaviour of DBus in
> either Debian or Devuan at the moment.

So I really hope that KDE developers are willing to make a change. Of=20
course they could argue, that it worked before=E2=80=A6

Until then I have a workaround for KRunner (a desktop file in Autostart)=20
and also one for XDG KDE portal.

It appears to me that in

% cat /usr/share/dbus-1/services/
org.freedesktop.impl.portal.desktop.kde.service
[D-BUS Service]
Name=3Dorg.freedesktop.impl.portal.desktop.kde
Exec=3D/usr/lib/x86_64-linux-gnu/libexec/xdg-desktop-portal-kde
SystemdService=3Dplasma-xdg-desktop-portal-kde.service

as well as

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

there is no provision to change the working directory for the started=20
DBUS service. At least I found no documentation of the specification of=20
those DBUS service files.

Something like

sh -c "cd $HOME; /usr/bin/krunner"

resulted in not starting the program at all.

I still found a work-around for the desktop portal, but it is not really=20
nice. I added the following as an autostart script to "~/.config/
autostart":

=2D----------------------------------------------------------------------

#!/bin/sh

cd $HOME

killall -u martin -e /usr/lib/x86_64-linux-gnu/libexec/xdg-desktop-
portal-kde
/usr/lib/x86_64-linux-gnu/libexec/xdg-desktop-portal-kde &>/dev/null &

cd -

=2D----------------------------------------------------------------------

This works as long as the process is running. In case I quit it again,=20
its autostarted again as a DBUS service and its current working=20
directory again points to "/". I consider opening a bug report for the
XDG KDE desktop portal as well.

Best,
=2D-=20
Martin



Acknowledgement sent to Martin Steigerwald <[email protected]>:
Extra info received and forwarded to list. Copy sent to Devuan Maintainers <[email protected]>. Full text available.
Information forwarded to [email protected], Devuan Maintainers <[email protected]>:
bug#745; Package dbus-x11. Full text available.

Message received at [email protected]:


Received: (at 745) by bugs.devuan.org; 6 Mar 2023 18:18:02 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from email.devuan.org [2001:41d0:2:d06e::5c4:2612]
	by doc.devuan.org with IMAP (fetchmail-6.4.16)
	for <debbugs@localhost> (single-drop); Mon, 06 Mar 2023 18:18:02 +0000 (UTC)
Received: from email.devuan.org
	by email.devuan.org with LMTP
	id MIloOTEuBmRBQgAAmSBk0A
	(envelope-from <[email protected]>)
	for <[email protected]>; Mon, 06 Mar 2023 18:17:21 +0000
Received: by email.devuan.org (Postfix, from userid 109)
	id D8B6666E; Mon,  6 Mar 2023 18:17:21 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on email.devuan.org
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_NONE autolearn=ham
	autolearn_force=no version=3.4.6
Received-SPF: None (mailfrom) identity=mailfrom; client-ip=2001:67c:14c:12f::11:100; helo=mail.lichtvoll.de; [email protected]; receiver=<UNKNOWN> 
Received: from mail.lichtvoll.de (lichtvoll.de [IPv6:2001:67c:14c:12f::11:100])
	by email.devuan.org (Postfix) with ESMTPS id CE1AB393
	for <[email protected]>; Mon,  6 Mar 2023 18:17:20 +0000 (UTC)
Received: from 127.0.0.1 (localhost [127.0.0.1])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384)
	(No client certificate requested)
	by mail.lichtvoll.de (Postfix) with ESMTPSA id 5BF77614155;
	Mon,  6 Mar 2023 19:17:19 +0100 (CET)
From: Martin Steigerwald <[email protected]>
To: Simon McVittie <[email protected]>, Mark Hindley <[email protected]>
Cc: [email protected], [email protected]
Subject:
 Re: bug#745: dbus-x11: Several processes in Plasma session including krunner
 have / as current working directory
Date: Mon, 06 Mar 2023 19:17:19 +0100
Message-ID: <[email protected]>
In-Reply-To: <[email protected]>
References:
 <[email protected]>
 <ZAYF3q/[email protected]>
 <[email protected]>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
Authentication-Results: mail.lichtvoll.de;
	auth=pass smtp.auth=martin [email protected]

Mark and Simon: thank you.

Mark Hindley - 06.03.23, 17:22:12 CET:
> On Mon, Mar 06, 2023 at 03:25:18PM +0000, Simon McVittie wrote:
> > What I absolutely don't want is to make the change, and then 2 years
> > later get hate mail from someone telling me that I've broken their
> > system by making dbus-launch prevent /home from being unmounted and
> > "why can't you just" add an option to use daemon(3).
>=20
> I think that is a very good point.
>=20
> KDE is the only area where I have heard of this causing problems and I
> am not aware of any other reports that seem to have the same
> underlying cause. =E2=80=A6

The upstream issue=C2=B9 refers to GNOME applications in RHEL 7 being=20
affected. RHEL 7 would have a KDE without Systemd startup I bet=C2=B2.

[1] https://gitlab.freedesktop.org/dbus/dbus/-/issues/214

[2] https://blog.davidedmundson.co.uk/blog/plasma-and-the-systemd-startup/ =
(however I am not entirely sure whether that kind of startup is=20
activated by default nowadays)

> I am not convinced there *is* a consensus for change and the risk of=20
> changing the default for all users of legacy DBus activation seems=20
> high.

=46air enough.

> Martin, I still think this is for KDE to address if it is important to
> them. I don't think I would push to change the behaviour of DBus in
> either Debian or Devuan at the moment.

I added that information and suggestion to the KDE bug report:

krunner starts applications with cwd "/" with init system other than=20
systemd (openrc, runit, ...)
https://bugs.kde.org/show_bug.cgi?id=3D432975#c16

Let's see whether KDE developers are open to make the required changes.

Thanks,
=2D-=20
Martin



Acknowledgement sent to Martin Steigerwald <[email protected]>:
Extra info received and forwarded to list. Copy sent to Devuan Maintainers <[email protected]>. Full text available.
Information forwarded to [email protected], Devuan Maintainers <[email protected]>:
bug#745; Package dbus-x11. Full text available.

Message received at [email protected]:


Received: (at 745) by bugs.devuan.org; 6 Mar 2023 16:22:35 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from email.devuan.org [2001:41d0:2:d06e::5c4:2612]
	by doc.devuan.org with IMAP (fetchmail-6.4.16)
	for <debbugs@localhost> (single-drop); Mon, 06 Mar 2023 16:22:35 +0000 (UTC)
Received: from email.devuan.org
	by email.devuan.org with LMTP
	id N7vzHD4TBmRCOwAAmSBk0A
	(envelope-from <[email protected]>)
	for <[email protected]>; Mon, 06 Mar 2023 16:22:22 +0000
Received: by email.devuan.org (Postfix, from userid 109)
	id 6A9C066E; Mon,  6 Mar 2023 16:22:22 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on email.devuan.org
X-Spam-Level: 
X-Spam-Status: No, score=0.4 required=5.0 tests=RDNS_DYNAMIC,SPF_PASS
	autolearn=no autolearn_force=no version=3.4.6
Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=193.36.131.86; helo=mx.hindley.org.uk; [email protected]; receiver=<UNKNOWN> 
Received: from mx.hindley.org.uk (193-36-131-86.cfwn.uk [193.36.131.86])
	by email.devuan.org (Postfix) with ESMTPS id 69327393
	for <[email protected]>; Mon,  6 Mar 2023 16:22:17 +0000 (UTC)
Received: from apollo.hindleynet ([192.168.1.3] helo=hindley.org.uk)
	by mx.hindley.org.uk with smtp (Exim 4.84_2)
	(envelope-from <[email protected]>)
	id 1pZDbI-00078s-So; Mon, 06 Mar 2023 16:22:12 +0000
Received: (nullmailer pid 7091 invoked by uid 1000);
	Mon, 06 Mar 2023 16:22:12 -0000
Date: Mon, 6 Mar 2023 16:22:12 +0000
From: Mark Hindley <[email protected]>
To: Simon McVittie <[email protected]>
Cc: Martin Steigerwald <[email protected]>, [email protected], [email protected]
Subject: Re: bug#745: dbus-x11: Several processes in Plasma session including
 krunner have / as current working directory
Message-ID: <[email protected]>
References: <[email protected]>
 <[email protected]>
 <ZAYF3q/[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <ZAYF3q/[email protected]>

Simon,

Thanks.

On Mon, Mar 06, 2023 at 03:25:18PM +0000, Simon McVittie wrote:
> What I absolutely don't want is to make the change, and then 2 years
> later get hate mail from someone telling me that I've broken their
> system by making dbus-launch prevent /home from being unmounted and
> "why can't you just" add an option to use daemon(3).

I think that is a very good point.

KDE is the only area where I have heard of this causing problems and I am not
aware of any other reports that seem to have the same underlying cause. I am not
convinced there *is* a consensus for change and the risk of changing the default
for all users of legacy DBus activation seems high.

Martin, I still think this is for KDE to address if it is important to them. I
don't think I would push to change the behaviour of DBus in either Debian or
Devuan at the moment.

Best wishes

Mark

Acknowledgement sent to Mark Hindley <[email protected]>:
Extra info received and forwarded to list. Copy sent to Devuan Maintainers <[email protected]>. Full text available.
Information forwarded to [email protected], Devuan Maintainers <[email protected]>:
bug#745; Package dbus-x11. Full text available.
Changed bug forwarded-to-address to 'https://gitlab.freedesktop.org/dbus/dbus/-/issues/214' from 'https://bugs.debian.org/1032368'. Request was from Simon McVittie <[email protected]> to [email protected]. Full text available.

Message received at [email protected]:


Received: (at 745) by bugs.devuan.org; 6 Mar 2023 15:25:33 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from email.devuan.org [2001:41d0:2:d06e::5c4:2612]
	by doc.devuan.org with IMAP (fetchmail-6.4.16)
	for <debbugs@localhost> (single-drop); Mon, 06 Mar 2023 15:25:33 +0000 (UTC)
Received: from email.devuan.org
	by email.devuan.org with LMTP
	id OuuEHusFBmTWOQAAmSBk0A
	(envelope-from <[email protected]>)
	for <[email protected]>; Mon, 06 Mar 2023 15:25:31 +0000
Received: by email.devuan.org (Postfix, from userid 109)
	id 704BE66E; Mon,  6 Mar 2023 15:25:31 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on email.devuan.org
X-Spam-Level: 
X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,SPF_NONE,UNPARSEABLE_RELAY
	autolearn=ham autolearn_force=no version=3.4.6
Received-SPF: None (mailfrom) identity=mailfrom; client-ip=2001:41b8:202:deb::311:108; helo=stravinsky.debian.org; [email protected]; receiver=<UNKNOWN> 
Received: from stravinsky.debian.org (stravinsky.debian.org [IPv6:2001:41b8:202:deb::311:108])
	by email.devuan.org (Postfix) with ESMTPS id C39FD393
	for <[email protected]>; Mon,  6 Mar 2023 15:25:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org;
	s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=2Svg6eajomoNYzAvdCMIG2JTpgQ8drChwZAF3xBrvu8=; b=CLjyeeA7J16gmdppuZYYTV284A
	Ol6UnI0JJOiBW31zu5gf9T+TQzSg5LZHFgHFWWX6qsatvS8gb0ZewE4lNbpygr+ofdat/mQEPbKXv
	37oGpLkcbMJmzCjx2Q+hDmy59jv2p8ihktIS+zWOqW6abg3cOjgQcxpT+SxkdbWbqtoRXGfag9nhG
	ksV2ky9HvTIuDPkLmdq8T+uS3U+Y2sWlqAicEKuslc/AF8lVnBoef3tV3zDc+tI0aC875O2b6eH5Z
	mnSjfkAmYBsa4sOgX+tx6DCggC9Ur/5+ViAOY+/ih96VxHJ5rodFheGZVmrE2EyjfqhvkI3Eal87b
	Lx4GloPw==;
Received: from authenticated user
	by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
	(Exim 4.94.2)
	(envelope-from <[email protected]>)
	id 1pZCiH-001uhu-3e; Mon, 06 Mar 2023 15:25:22 +0000
Date: Mon, 6 Mar 2023 15:25:18 +0000
From: Simon McVittie <[email protected]>
To: Mark Hindley <[email protected]>
Cc: Martin Steigerwald <[email protected]>, [email protected],
	[email protected]
Subject: Re: bug#745: dbus-x11: Several processes in Plasma session including
 krunner have / as current working directory
Message-ID: <ZAYF3q/[email protected]>
References: <[email protected]>
 <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[email protected]>
X-Debian-User: smcv

Control: forwarded -1 https://gitlab.freedesktop.org/dbus/dbus/-/issues/214

On Mon, 06 Mar 2023 at 11:52:08 +0000, Mark Hindley wrote:
> Simon, might the implications of that be reviewed again upstream? I
> found an upstream issue with patch to implement such behaviour that has not been
> merged <https://gitlab.freedesktop.org/dbus/dbus/-/issues/214>.

I had completely forgotten about that issue report. At least I'm
consistent: 4 years ago, I also said something along the lines of "maybe,
but I'm concerned that this is going to break someone's workflow". If
there is consensus even among the users of highly change-averse
distributions that $HOME is a better working directory than /, then maybe
this can/should change in the dbus 1.15.x and Debian-13-as-testing cycle.

As you said, during the Debian 12 freeze is not the time to change this.
dbus 1.16.0 would be the earliest stable release of dbus that is likely
to have this behaviour change upstream, although obviously Devuan is
already patching the dbus package and is free to backport whatever
changes they are willing to take responsibility for.

What I absolutely don't want is to make the change, and then 2 years
later get hate mail from someone telling me that I've broken their
system by making dbus-launch prevent /home from being unmounted and
"why can't you just" add an option to use daemon(3).

Because the recommended and most-common way to run the session bus in
2023 is via the dbus.service managed by `systemd --user` (that's the
dbus-user-session package in Debian), it is primarily users of more
traditional system configurations (sysv-rc or similar, X11, dbus-x11,
dbus-launch) that will be affected by this. I do not have enough time
available for dbus to carry out testing on arbitrary OS configurations,
and I am not able to take responsibility for researching whether this
will break anyone's use-case. It's up to the people who maintain those
more traditional system configurations to tell me whether dbus/dbus#214
is what you want or not.

Because dbus-launch is already poorly-understood spaghetti code, I
specifically don't want this to be a configuration option: it should
either always use $HOME as in David King's proposed patch, or always use
"/" as it does in 1.14.x. Having two rarely-tested code paths is worse
than having one.

    smcv

Acknowledgement sent to Simon McVittie <[email protected]>:
Extra info received and forwarded to list. Copy sent to Devuan Maintainers <[email protected]>. Full text available.
Information forwarded to [email protected], Devuan Maintainers <[email protected]>:
bug#745; Package dbus-x11. Full text available.

Message received at [email protected]:


Received: (at 745) by bugs.devuan.org; 6 Mar 2023 14:39:11 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from email.devuan.org [2001:41d0:2:d06e::5c4:2612]
	by doc.devuan.org with IMAP (fetchmail-6.4.16)
	for <debbugs@localhost> (single-drop); Mon, 06 Mar 2023 14:39:11 +0000 (UTC)
Received: from email.devuan.org
	by email.devuan.org with LMTP
	id mLGtDdX6BWTjOAAAmSBk0A
	(envelope-from <[email protected]>)
	for <[email protected]>; Mon, 06 Mar 2023 14:38:13 +0000
Received: by email.devuan.org (Postfix, from userid 109)
	id 3184166E; Mon,  6 Mar 2023 14:38:13 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on email.devuan.org
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_NONE autolearn=ham
	autolearn_force=no version=3.4.6
Received-SPF: None (mailfrom) identity=mailfrom; client-ip=2001:67c:14c:12f::11:100; helo=mail.lichtvoll.de; [email protected]; receiver=<UNKNOWN> 
Received: from mail.lichtvoll.de (lichtvoll.de [IPv6:2001:67c:14c:12f::11:100])
	by email.devuan.org (Postfix) with ESMTPS id 1C897393
	for <[email protected]>; Mon,  6 Mar 2023 14:38:10 +0000 (UTC)
Received: from 127.0.0.1 (localhost [127.0.0.1])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384)
	(No client certificate requested)
	by mail.lichtvoll.de (Postfix) with ESMTPSA id 2FA11613DDE;
	Mon,  6 Mar 2023 15:38:06 +0100 (CET)
From: Martin Steigerwald <[email protected]>
To: [email protected], Mark Hindley <[email protected]>
Cc: Simon McVittie <[email protected]>, [email protected]
Subject:
 Re: bug#745: dbus-x11: Several processes in Plasma session including krunner
 have / as current working directory
Date: Mon, 06 Mar 2023 15:38:05 +0100
Message-ID: <[email protected]>
In-Reply-To: <[email protected]>
References:
 <[email protected]> <[email protected]>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
Authentication-Results: mail.lichtvoll.de;
	auth=pass smtp.auth=martin [email protected]

Dear Mark.

Thanks for looking at this!

Mark Hindley - 06.03.23, 12:52:08 CET:
> On Sun, Mar 05, 2023 at 09:59:35AM +0100, Martin Steigerwald wrote:
> > Package: dbus-x11
> > Version: 1.14.6-1devuan1
> > Severity: normal
> > X-Debbugs-Cc: [email protected]
> >=20
> > Dear Maintainer,
> >=20
> > I also reported this to Debian as
>=20
> Simon McVittie's is, of course, correct that src:dbus being forked in
> Devuan means this should be dealt with in Devuan. Notwithstanding
> that, I am very grateful for his thorough, considered and
> illuminating reply. The same behaviour is evident in a non-systemd
> Debian installation.

Yeah. Lorenzo confirmed this as well. He was able to replicate the issue=20
on a Debian installation.

> Like Simon, I have no experience of KDE or krunner. I also agree that
> legacy DBus activation appears to be working here as intended and
> documented, with no guarantee on the cwd given.

Again: it is a kind of quick application starter. You press Alt-Space,=20
enter something, it offers a variety of matches, you select one and press=20
enter or just press enter to use the first match and that's it. If=20
krunner's pwd is "/" then the application it started usually also has=20
"/". Which means any file dialog started from it will have "/".

Additionally meanwhile I found that when I print a web site to PDF in=20
=46irefox the file dialog also starts with "/". This could be due to

export GTK_USE_PORTAL=3D1

in order to use KDE based file dialog with Firefox and other apps that=20
use GTK.

None of this breaks the system. It just makes it more cumbersome to use.

I also wonder whether only Plasma desktop is affected.

> My gut reaction is that this issue is should really be resolved
> elsewhere. If it is crucial that krunner uses a particular working
> directory, then it needs to chdir() explicitly itself.

I understand. I  add this this suggestion to the KDE bug report. However=20
as noted above: Besides KRunner some other processes appear to be=20
affected. So it would be required to file an upstream report with any of=20
those affected components. Might be the cleanest approach still.=20
Especially as long as there are no guarantees.

I always thought that anything within a user session is using $HOME as=20
pwd, but apparently that does not seem to be guaranteed or documented.=20
And it may have been like that back in the days where almost everything=20
related to a user desktop session was started from one place that=20
started out from $HOME and all the child processes inherited pwd from=20
that place.

It appears that for systems with other init systems there does not seem=20
to be a consistent approach to handle this.

> I also quite understand his concern that changing the behaviour of
> DBus may have unintended consequences and I am certain that changing
> the behaviour of DBus during the freeze will not happen. I suppose
> early in the next cycle is possible. [=E2=80=A6]

Sure.

As I think that Simon is right and it is indeed is "/etc/X11/Xsession.d/
75dbus_dbus-launch" that started the session dbus. I mismatched the=20
arguments and while I saw a third DBUS running under the user=20
"messagebus" I did not make the connection that this is the one that is=20
started by the runit service dir.

So my next approach would be to play around with "/etc/X11/Xsession.d/
75dbus_dbus-launch". First step would be to figure out whether "$HOME" is=20
set to the session user home directory in that script. If yes, I'd try=20
changing working directory to $HOME. If not=E2=80=A6 I am not sure, I may s=
till=20
go for changing pwd to the home directory of the main user of my system=20
to actually verify whether this would be working as a work-around.

Will report back once I know more.

> Simon, might the implications of that be reviewed again upstream? I=20
> found an upstream issue with patch to implement such behaviour that=20
> has not been merged[1].

Interesting. That is from 4 years ago already.

> [1]  https://gitlab.freedesktop.org/dbus/dbus/-/issues/214

Thanks,
=2D-=20
Martin



Acknowledgement sent to Martin Steigerwald <[email protected]>:
Extra info received and forwarded to list. Copy sent to Devuan Maintainers <[email protected]>. Full text available.
Information forwarded to [email protected], Devuan Maintainers <[email protected]>:
bug#745; Package dbus-x11. Full text available.
Added tag(s) patch and upstream. Request was from Mark Hindley <[email protected]> to [email protected]. Full text available.
Set bug forwarded-to-address to 'https://bugs.debian.org/1032368'. Request was from Mark Hindley <[email protected]> to [email protected]. Full text available.

Message received at [email protected]:


Received: (at 745) by bugs.devuan.org; 6 Mar 2023 11:52:35 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from email.devuan.org [2001:41d0:2:d06e::5c4:2612]
	by doc.devuan.org with IMAP (fetchmail-6.4.16)
	for <debbugs@localhost> (single-drop); Mon, 06 Mar 2023 11:52:35 +0000 (UTC)
Received: from email.devuan.org
	by email.devuan.org with LMTP
	id H+zhA+/TBWRnNAAAmSBk0A
	(envelope-from <[email protected]>)
	for <[email protected]>; Mon, 06 Mar 2023 11:52:15 +0000
Received: by email.devuan.org (Postfix, from userid 109)
	id 047F466D; Mon,  6 Mar 2023 11:52:14 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on email.devuan.org
X-Spam-Level: 
X-Spam-Status: No, score=0.4 required=5.0 tests=RDNS_DYNAMIC,SPF_PASS
	autolearn=no autolearn_force=no version=3.4.6
Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=193.36.131.86; helo=mx.hindley.org.uk; [email protected]; receiver=<UNKNOWN> 
Received: from mx.hindley.org.uk (193-36-131-86.cfwn.uk [193.36.131.86])
	by email.devuan.org (Postfix) with ESMTPS id D029532
	for <[email protected]>; Mon,  6 Mar 2023 11:52:10 +0000 (UTC)
Received: from apollo.hindleynet ([192.168.1.3] helo=hindley.org.uk)
	by mx.hindley.org.uk with smtp (Exim 4.84_2)
	(envelope-from <[email protected]>)
	id 1pZ9Nw-0005cy-TM; Mon, 06 Mar 2023 11:52:09 +0000
Received: (nullmailer pid 11922 invoked by uid 1000);
	Mon, 06 Mar 2023 11:52:08 -0000
Date: Mon, 6 Mar 2023 11:52:08 +0000
From: Mark Hindley <[email protected]>
To: Martin Steigerwald <[email protected]>, [email protected]
Cc: Simon McVittie <[email protected]>, [email protected]
Subject: Re: bug#745: dbus-x11: Several processes in Plasma session including
 krunner have / as current working directory
Message-ID: <[email protected]>
References: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[email protected]>
X-Debbugs-No-Ack: No Thanks

Control: forwarded -1  https://bugs.debian.org/1032368

Martin,

Thanks for this.

On Sun, Mar 05, 2023 at 09:59:35AM +0100, Martin Steigerwald wrote:
> Package: dbus-x11
> Version: 1.14.6-1devuan1
> Severity: normal
> X-Debbugs-Cc: [email protected]
> 
> Dear Maintainer,
> 
> I also reported this to Debian as

Simon McVittie's is, of course, correct that src:dbus being forked in Devuan
means this should be dealt with in Devuan. Notwithstanding that, I am very
grateful for his thorough, considered and illuminating reply. The same behaviour
is evident in a non-systemd Debian installation.

Like Simon, I have no experience of KDE or krunner. I also agree that legacy
DBus activation appears to be working here as intended and documented, with no
guarantee on the cwd given.

My gut reaction is that this issue is should really be resolved elsewhere. If
it is crucial that krunner uses a particular working directory, then it needs to
chdir() explicitly itself.

I also quite understand his concern that changing the behaviour of DBus may have
unintended consequences and I am certain that changing the behaviour of DBus
during the freeze will not happen. I suppose early in the next cycle is
possible. Simon, might the implications of that be reviewed again upstream? I
found an upstream issue with patch to implement such behaviour that has not been
merged[1].

Thanks

Mark

[1]  https://gitlab.freedesktop.org/dbus/dbus/-/issues/214


Information forwarded to [email protected], Devuan Maintainers <[email protected]>:
bug#745; Package dbus-x11. Full text available.

Message received at [email protected]:


Received: (at submit) by bugs.devuan.org; 5 Mar 2023 09:00:01 +0000
Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from email.devuan.org [2001:41d0:2:d06e::5c4:2612]
	by doc.devuan.org with IMAP (fetchmail-6.4.16)
	for <debbugs@localhost> (single-drop); Sun, 05 Mar 2023 09:00:01 +0000 (UTC)
Received: from email.devuan.org
	by email.devuan.org with LMTP
	id WJEnEv5ZBGSodQAAmSBk0A
	(envelope-from <[email protected]>)
	for <[email protected]>; Sun, 05 Mar 2023 08:59:42 +0000
Received: by email.devuan.org (Postfix, from userid 109)
	id 3739866F; Sun,  5 Mar 2023 08:59:42 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on email.devuan.org
X-Spam-Level: *
X-Spam-Status: No, score=1.0 required=5.0 tests=KHOP_HELO_FCRDNS,SPF_NONE
	autolearn=no autolearn_force=no version=3.4.6
Received-SPF: None (mailfrom) identity=mailfrom; client-ip=194.150.191.11; helo=mail.lichtvoll.de; [email protected]; receiver=<UNKNOWN> 
Received: from mail.lichtvoll.de (luna.lichtvoll.de [194.150.191.11])
	by email.devuan.org (Postfix) with ESMTPS id BFB9F32
	for <[email protected]>; Sun,  5 Mar 2023 08:59:37 +0000 (UTC)
Received: from 127.0.0.1 (localhost [127.0.0.1])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384)
	(No client certificate requested)
	by mail.lichtvoll.de (Postfix) with ESMTPSA id 1C556611918
	for <[email protected]>; Sun,  5 Mar 2023 09:59:36 +0100 (CET)
From: Martin Steigerwald <[email protected]>
To: [email protected]
Subject:
 dbus-x11: Several processes in Plasma session including krunner have / as
 current working directory
Date: Sun, 05 Mar 2023 09:59:35 +0100
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
Authentication-Results: mail.lichtvoll.de;
	auth=pass smtp.auth=martin [email protected]

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

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:

=E2=80=A6proc# ls -ld $(pidof krunner)/cwd
lrwxrwxrwx 1 USER USER 0 10. Feb 14:26 15116/cwd -> /
=E2=80=A6proc# 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=20
have also seen this on systems where the user shell is Bash.

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

Plasmashell instead is going like this

=E2=94=9C=E2=94=80runsv(2066)=E2=94=80=E2=94=AC=E2=94=80sddm(2116)=E2=94=80=
=E2=94=AC

=E2=94=80sddm-helper(8989)=E2=94=80=E2=94=80=E2=94=80startplasma-x11(8994)=
=E2=94=80=E2=94=AC=E2=94=80plasma_session(9056)=E2=94=80=E2=94=AC

This is reported with KDE as:

krunner starts applications with cwd "/" with init system other than=20
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=3Dorg.kde.krunner
Exec=3D/usr/bin/krunner
SystemdService=3Dplasma-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=20
kwalletd=20
and kiod5 is also /. I bet those are started by the corresponding=20
service files in /usr/share/dbus-1/services.

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

=46or Systemd based systems Plasma uses Systemd service files for startup,=
=20
so
dbus-x11 is not involved.

Thanks,
Martin

=2D- 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=3Dde_DE.UTF-8, LC_CTYPE=3Dde_DE.UTF-8 (charmap=3DUTF-8),=20
LANGUAGE=3Dde
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.

=2D- debconf-show failed
=2D-=20
Martin



Acknowledgement sent to Martin Steigerwald <[email protected]>:
New bug report received and forwarded. Copy sent to [email protected], Devuan Maintainers <[email protected]>. Full text available.
Report forwarded to [email protected], [email protected], Devuan Maintainers <[email protected]>:
bug#745; Package dbus-x11. Full text available.

Devuan BTS -- Powered by Debian bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.

Devuan Bugs Owner <[email protected]>.
Last modified: Sat, 18 Jan 2025 04:39:02 UTC