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

Fix hang when trying to activate a systemd service with unsatisfied conditions #285

Closed msizanoen1 closed 2 years ago

msizanoen1 commented 2 years ago

When systemd is requested to start a service with unsatisfied conditions, it will report that the service was started successfully but in reality the service was never started. This causes the client trying to call a method on a DBus-activated service to hang or timeout instead of receiving an error.

This PR fix this by checking for the ConditionResult property on the service unit object and fail activation if it's false.

How to reproduce:

Expected result: Call failed: Could not activate remote peer.

Actual result: The command times out.

Fixes #276

msizanoen1 commented 2 years ago

Now that this PR has been manually applied, #276 needs to be closed manually.