feat(dbus): Update systemd unit state check to include 'activating'

Previously, the check only considered 'active' as a valid ActiveState.
This update ensures the system also accounts for units in the
'activating' state, improving compatibility with transitional states in
systemd services.

Signed-off-by: Sven Sager <s.sager@kunbus.com>
This commit is contained in:
Sven Sager
2025-05-27 14:54:44 +02:00
parent 9ec1e04d2b
commit 66046b6a9d

View File

@@ -100,7 +100,10 @@ def simple_systemd(action: ServiceActions, unit: str, unmask: bool = False) -> O
log.warning(f"could not get systemd unit {unit}")
return False
return properties.UnitFileState == "enabled" and properties.ActiveState == "active"
return properties.UnitFileState == "enabled" and properties.ActiveState in (
"active",
"activating",
)
elif action is ServiceActions.AVAILABLE:
try: