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.
That chuck of code was introduced to fix Bug #13884, removing it may break the ability to run thunar with sudo.
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. )
(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.
(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".
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.
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.
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
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.
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