diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-08-09 23:33:48 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-08-09 23:53:49 +0200 |
commit | 47342320a097523d93040cdd627e237a420572c5 (patch) | |
tree | 463f92f1fb526d26e07a7d2419bb98ed0e4ab3f8 /src/service.c | |
parent | 76143638fdabee59dcd5db81fe46c900299da425 (diff) |
main: fix auto restarting of units after a configuration reload
Diffstat (limited to 'src/service.c')
-rw-r--r-- | src/service.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/service.c b/src/service.c index d6086ca410..318d8a7dc4 100644 --- a/src/service.c +++ b/src/service.c @@ -1500,7 +1500,7 @@ static void service_enter_dead(Service *s, bool success, bool allow_restart) { s->failure = true; if (allow_restart && - s->allow_restart && + !s->forbid_restart && (s->restart == SERVICE_RESTART_ALWAYS || (s->restart == SERVICE_RESTART_ON_SUCCESS && !s->failure))) { @@ -1511,6 +1511,8 @@ static void service_enter_dead(Service *s, bool success, bool allow_restart) { } else service_set_state(s, s->failure ? SERVICE_MAINTENANCE : SERVICE_DEAD); + s->forbid_restart = false; + return; fail: @@ -1932,7 +1934,7 @@ static int service_start(Unit *u) { s->failure = false; s->main_pid_known = false; - s->allow_restart = true; + s->forbid_restart = false; service_enter_start_pre(s); return 0; @@ -1945,7 +1947,7 @@ static int service_stop(Unit *u) { /* This is a user request, so don't do restarts on this * shutdown. */ - s->allow_restart = false; + s->forbid_restart = true; /* Already on it */ if (s->state == SERVICE_STOP || |