core: do not restart a service with Restart=always when ExecCondition fails
When a Condition*= fails, and a service has Restart=always, the service is not restarted. Follow the same behaviour for ExecCondition= to avoid inconsistencies. Fixes #22257
This commit is contained in:
+1
-1
@@ -1798,7 +1798,7 @@ static bool service_shall_restart(Service *s, const char **reason) {
|
||||
return false;
|
||||
|
||||
case SERVICE_RESTART_ALWAYS:
|
||||
return true;
|
||||
return s->result != SERVICE_SKIP_CONDITION;
|
||||
|
||||
case SERVICE_RESTART_ON_SUCCESS:
|
||||
return s->result == SERVICE_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user