! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thunar does not provide org.xfce.FileManager dbus service
Status:
RESOLVED: FIXED

Comments

Description Mukundan Ragavan 2019-02-19 23:37:46 CET
Created attachment 8311 
patch tested by downstream reporter

This is the downstream bug report - 

https://bugzilla.redhat.com/show_bug.cgi?id=1665577


Problem description quoted from downstream bug report


Thunar-1.8.2-1.fc30 (currently installed on my machine) has two dbus files:

/usr/share/dbus-1/services/org.xfce.Thunar.service
[D-BUS Service]
Name=org.xfce.Thunar
Exec=/usr/bin/Thunar --gapplication-service
SystemdService=thunar.service

/usr/share/dbus-1/services/org.xfce.FileManager.service
[D-BUS Service]
Name=org.xfce.FileManager
Exec=/usr/bin/Thunar --gapplication-service
SystemdService=thunar.service

My reading of the second file is that it is intended to provide org.xfce.FileManager service, either via systemd or dbus.

However, it appears to only work over systemd. If you do not run systemd, it tries to but does not work over dbus, I guess because Thunar does not actually register "org.xfce.FileManager" service, only "org.xfce.Thunar" one.

Here how it fails:

# time dbus-send --print-reply --session --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.StartServiceByName string:org.xfce.FileManager uint32:0
Error org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
real	0m25.010s
user	0m0.004s
sys	0m0.002s

Starting "org.xfce.Thunar" service works:

# dbus-send --print-reply --session --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.StartServiceByName string:org.xfce.Thunar uint32:0
method return time=1547237509.405417 sender=org.freedesktop.DBus -> destination=:1.4218 serial=3 reply_serial=2
   uint32 2

The symptom of this problem is that applications such as Ristretto (image viewer) and Thunderbird (mail reader) have a 25 second delay on startup.




Patch used to fix this issue provided by downstream reporter is attached.
Comment 1 Andre Miranda editbugs 2019-02-23 21:19:55 CET
That chuck of code was introduced to fix Bug #13884, removing it may break the ability to run thunar with sudo.
Comment 2 alexxcons editbugs 2019-02-24 20:40:32 CET
Soo it looks like you are starting the dbus service ( thunar --daemon ) as root ?
Cant you start is as the logged in user ?  ( I guess to run it as root is not a good idea anyway, due to security risks. )
Comment 3 Denys Vlasenko 2019-02-27 14:19:40 CET
(In reply to alexxcons from comment #2)
> Soo it looks like you are starting the dbus service ( thunar --daemon ) as root?

No, I'm running "ristretto FILE.jpg" and it takes 25 seconds to start.

> Cant you start is as the logged in user?

The logged-in user is root.
Comment 4 Denys Vlasenko 2019-02-27 14:21:31 CET
(In reply to Andre Miranda from comment #1)
> That chuck of code was introduced to fix Bug #13884, removing it may break the ability to run thunar with sudo.

The fix was introduced as
>> Created attachment 7342 
>> an ugly workaround
>> I'm not sure if just skipping the name registration is the correct fix.

Indeed, it is a "ugly workaround", it's basically "let's just break Thunar for root".
Comment 5 alexxcons editbugs 2019-02-28 22:46:40 CET
Possibly we could remove  the root check and add an advice for sudo users to the error message in thunar_application_dbus_name_lost_cb.
E.g: "If you run thunar as root/sudo, and see this error, you might need to install the package 'dbus-x11' to use $serviceName"

According to the comments in Bug #13884, it solved the sudo issue .. however I have to test that first.
Comment 6 alexxcons editbugs 2019-03-08 23:29:16 CET
Created attachment 8328 
patch

Seems to work fine with / without sudo if dbus-x11 is present.

The package-name seems to be consistant over different distros.

So I would go for that fix, if you are agree.
Comment 7 Git Bot editbugs 2019-03-18 00:36:47 CET
Andre Miranda referenced this bugreport in commit 59218fc21c304011b0dd5b2e1f07ac8344c5aacb

Do not exit when dbus name registration fails (Bug #15149)

https://git.xfce.org/xfce/thunar/commit?id=59218fc21c304011b0dd5b2e1f07ac8344c5aacb
Comment 8 Andre Miranda editbugs 2019-03-18 00:42:05 CET
As discussed with Alex, with the commit above running Thunar with sudo we should expect no session for root user, all calls to Thunar via dbus should be handled by the regular user instance, no need to exit or show warning/info dialogs.
Comment 9 Git Bot editbugs 2019-03-18 23:17:11 CET
Andre Miranda referenced this bugreport in commit dc5b10aec192514546f3989fcf010bece676b679

Do not exit when dbus name registration fails (Bug #15149)

https://git.xfce.org/xfce/thunar/commit?id=dc5b10aec192514546f3989fcf010bece676b679

Bug #15149

Reported by:
Mukundan Ragavan
Reported on: 2019-02-19
Last modified on: 2019-03-18

People

Assignee:
alexxcons
CC List:
5 users

Version

Attachments

patch tested by downstream reporter (581 bytes, patch)
2019-02-19 23:37 CET , Mukundan Ragavan
no flags
patch (1.36 KB, patch)
2019-03-08 23:29 CET , alexxcons
no flags

Additional information