core: do not restart a service with Restart=always when ExecCondition fails
authorLuca Boccassi <luca.boccassi@microsoft.com>
Wed, 26 Jan 2022 19:00:25 +0000 (19:00 +0000)
committerLuca Boccassi <luca.boccassi@microsoft.com>
Wed, 26 Jan 2022 19:02:11 +0000 (19:02 +0000)
commitabb99360d3317980fc8843f79b67c763cd4a9a2c
treefc567309bf3563caf97b4db430d020dc24e324b2
parent9d3bb25b2da77d35d84e986dd71c5823958d6e67
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
src/core/service.c
test/units/testsuite-51-repro-3.service [new file with mode: 0644]
test/units/testsuite-51.sh