1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00

core: disable the effect of Restart= if there's a stop job pending for a service (#6581)

We shouldn't undo the job already enqueued, under any circumstances.

Fixes: #6504
This commit is contained in:
Lennart Poettering 2017-08-26 15:07:23 +02:00 committed by Yu Watanabe
parent 9b9c30ec75
commit 0f52f8e552

View File

@ -1498,8 +1498,14 @@ static bool service_will_restart(Service *s) {
static void service_enter_dead(Service *s, ServiceResult f, bool allow_restart) {
int r;
assert(s);
/* If there's a stop job queued before we enter the DEAD state, we shouldn't act on Restart=, in order to not
* undo what has already been enqueued. */
if (unit_stop_pending(UNIT(s)))
allow_restart = false;
if (s->result == SERVICE_SUCCESS)
s->result = f;