Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#79186 - [telegram-desktop] Fail to execute through DBUS

Attached to Project: Arch Linux
Opened by avimitin (avimitin) - Monday, 24 July 2023, 04:07 GMT
Last edited by Toolybird (Toolybird) - Monday, 24 July 2023, 22:04 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

Telegram-desktop introduces dbus activation in the latest v4.8.7 version <https://github.com/telegramdesktop/tdesktop/commit/2dfe85832717ccfd9268a5b767f03eb4e8665b8f#>.
And after these changes, KDE krunner can not launch telegram-desktop because it fail to find excutable specify in the Exec field in the service file.
It does find it after I change the value to "/usr/bin/telegram-desktop".
I don't know if this is a local misconfiguration or if we should patch the service file.

```diff
--- /usr/share/dbus-1/services/org.telegram.desktop.service.orig
+++ /usr/share/dbus-1/services/org.telegram.desktop.service
@@ -1,3 +1,3 @@
[D-BUS Service]
Name=org.telegram.desktop
-Exec=telegram-desktop
+Exec=/usr/bin/telegram-desktop
```
This task depends upon

Closed by  Toolybird (Toolybird)
Monday, 24 July 2023, 22:04 GMT
Reason for closing:  Fixed
Additional comments about closing:  telegram-desktop 4.8.7-2
Comment by Andrew Shark (ashark) - Monday, 24 July 2023, 06:31 GMT
I can confirm the problem
Comment by Jean-Louis Dupond (dupondje) - Monday, 24 July 2023, 06:40 GMT
Same issue on Gnome
Comment by avimitin (avimitin) - Monday, 24 July 2023, 06:41 GMT
I have tried to debug this issue, and I found that the `Exec` field in dbus service file will try to find the executable from PATH environment variable if it is not an absolute path <https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables>. So it must be a PATH env issue. But I write a program to write the PATH env into file, and found that the PATH env is set correctly. So I am confused by the dbus issue.

* My program (Rust)

```rust
fn main() {
let path = std::env::var("PATH").expect("fail to get PATH variable");
std::fs::write("/tmp/dbus-test.txt", path).expect("write fail");
}
```

* Then modify the service file

[D-BUS Service]
Name=org.telegram.desktop
Exec=/tmp/redirect

* And execute it (I found this from https://github.com/KDE/kio/blob/master/src/gui/dbusactivationrunner.cpp#L57)

qdbus org.telegram.desktop /org/telegram/desktop org.freedesktop.Application ActivateAction

* And the result:

/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
Comment by q rty (q234rty) - Monday, 24 July 2023, 08:32 GMT
DBus service files are not the same as desktop entries.
Comment by avimitin (avimitin) - Monday, 24 July 2023, 08:42 GMT
Yes, it seems that the dbus service manual doesn't mention that it supports finding executables from PATH: https://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-starting-services.
Comment by avimitin (avimitin) - Monday, 24 July 2023, 09:09 GMT
I have added a PR to fix this issue: https://github.com/telegramdesktop/tdesktop/pull/26565.
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 24 July 2023, 09:53 GMT
Alright thanks guys, check rel-2.
Comment by Toolybird (Toolybird) - Monday, 24 July 2023, 22:00 GMT
Dupe  FS#79192 

Loading...