bus1 / dbus-broker

Linux D-Bus Message Broker
https://github.com/bus1/dbus-broker/wiki
Apache License 2.0
667 stars 78 forks source link

Activation failure isn't detected with transient systemd unit #314

Open amezin opened 1 year ago

amezin commented 1 year ago
$ cat ~/.local/share/dbus-1/services/com.github.amezin.false.service 
[D-BUS Service]
Name=com.github.amezin.false
Exec=false
$ dbus-send --session --dest=org.freedesktop.DBus --print-reply --reply-timeout=120000 /org/freedesktop/DBus org.freedesktop.DBus.StartServiceByName string:'com.github.amezin.false' 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.

While, obviously, the service fails (almost) immediately.

In journal:

Created slice Slice /app/dbus-:1.2-com.github.amezin.false.
Started dbus-:1.2-com.github.amezin.false@0.service.
dbus-:1.2-com.github.amezin.false@0.service: Main process exited, code=exited, status=1/FAILURE
dbus-:1.2-com.github.amezin.false@0.service: Failed with result 'exit-code'.

And it seems that activation won't be attempted again until dbus-broker is restarted. So, if there was some issue with, for example, service configuration, or missing dependencies, after fixing it I'll have to log out and login again - for session bus, or restart the system completely - for system bus.

teg commented 1 year ago

Thank you for your report!

Which version of dbus-broker are you using?

amezin commented 1 year ago

v33, from Arch Linux repository