diff --git a/src/core/service.c b/src/core/service.c index c436650791..c7c5225115 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -1648,13 +1648,7 @@ static Service *service_get_triggering_service(Service *s) { * or OnSuccess= then we return NULL. This is since we don't know from which * one to propagate the exit status. */ - UNIT_FOREACH_DEPENDENCY(other, UNIT(s), UNIT_ATOM_ON_FAILURE_OF) { - if (candidate) - goto have_other; - candidate = other; - } - - UNIT_FOREACH_DEPENDENCY(other, UNIT(s), UNIT_ATOM_ON_SUCCESS_OF) { + UNIT_FOREACH_DEPENDENCY(other, UNIT(s), UNIT_ATOM_ON_SUCCESS_OF|UNIT_ATOM_ON_FAILURE_OF) { if (candidate) goto have_other; candidate = other; diff --git a/test/units/TEST-68-PROPAGATE-EXIT-STATUS.sh b/test/units/TEST-68-PROPAGATE-EXIT-STATUS.sh index 11da48aba0..d717ce5a55 100755 --- a/test/units/TEST-68-PROPAGATE-EXIT-STATUS.sh +++ b/test/units/TEST-68-PROPAGATE-EXIT-STATUS.sh @@ -30,7 +30,7 @@ cat >/run/systemd/system/testservice-failure-68.service </run/systemd/system/testservice-failure-68-template.service </run/systemd/system/testservice-failure-68-template.service </run/systemd/system/testservice-success-68.service </run/systemd/system/testservice-success-68.service </run/systemd/system/testservice-success-68-template.service </run/systemd/system/testservice-success-68-template.service </run/systemd/system/testservice-success-and-failure-68.service <