1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-04-18 07:35:22 +01:00

Call Subscribe on systemd D-Bus connect to enable signals (#6659)

systemd only emits bus signals (including PropertiesChanged) when at
least one client has called Subscribe() on the Manager interface. On
regular HAOS systems, systemd-logind calls Subscribe which enables
signals for all bus clients. However, in environments without
systemd-logind (such as the Supervisor devcontainer with systemd), no
signals are emitted, causing the firewall unit wait to time out.

Explicitly calling Subscribe() has no downsides and makes it clear
that the Supervisor relies on these signals. There is no need to call
Unsubscribe() as systemd automatically tracks clients and stops
emitting signals when all subscribers have disconnected from the bus.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Stefan Agner
2026-03-23 14:21:09 +01:00
committed by GitHub
parent 0cb96c36b6
commit c9a2da34c2
3 changed files with 22 additions and 0 deletions

View File

@@ -656,6 +656,10 @@ class Systemd(DBusServiceMock):
def PowerOff(self) -> None:
"""Power off host computer."""
@dbus_method()
def Subscribe(self) -> None:
"""Subscribe to systemd signals."""
@dbus_method()
def StartUnit(self, name: "s", mode: "s") -> "o":
"""Start a service unit."""