summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Ward <david.ward@ll.mit.edu>2012-04-02 23:45:35 -0400
committerLennart Poettering <lennart@poettering.net>2012-04-03 14:27:13 +0200
commit48bb58769a00e8e50a617ebbfff84599a0350fa5 (patch)
treef4b0ee50f227074dd91db045f0230b4b491c03c4 /src
parent6070fe66ac2f317e7e85e5685f0916d1e2b73a28 (diff)
service: schedule JOB_RESTART from SERVICE_AUTO_RESTART state
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45511
Diffstat (limited to 'src')
-rw-r--r--src/service.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/service.c b/src/service.c
index 8b5c0b07c4..bf2e0a9d98 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2208,9 +2208,12 @@ static void service_enter_restart(Service *s) {
goto fail;
}
- service_enter_dead(s, SERVICE_SUCCESS, false);
-
- if ((r = manager_add_job(UNIT(s)->manager, JOB_START, UNIT(s), JOB_FAIL, false, &error, NULL)) < 0)
+ /* Any units that are bound to this service must also be
+ * restarted. We use JOB_RESTART (instead of the more obvious
+ * JOB_START) here so that those dependency jobs will be added
+ * as well. */
+ r = manager_add_job(UNIT(s)->manager, JOB_RESTART, UNIT(s), JOB_FAIL, false, &error, NULL);
+ if (r < 0)
goto fail;
log_debug("%s scheduled restart job.", UNIT(s)->id);