Consider systemd status only relevant if unit is available

If the unit is not available is is not possible to tell whether the
service is running or not so the systemd status should not be
considered yet. As soon as the status changes Systemd::apply() is
executed again and the status possibly considered.
This commit is contained in:
Martchus 2019-07-25 18:32:52 +02:00
parent 7e46096feb
commit 1ce8ec9c5f
1 changed files with 1 additions and 1 deletions

View File

@ -422,7 +422,7 @@ Systemd::ServiceStatus Systemd::apply(
if (!service) {
return ServiceStatus{};
}
const auto isRelevant = service->isSystemdAvailable() && connection.isLocal();
const auto isRelevant = service->isSystemdAvailable() && service->isUnitAvailable() && connection.isLocal();
const auto isRunning = service->isRunning();
const auto consideredForReconnect = considerForReconnect && isRelevant;