[systemd-devel] [PATCH v2] service: schedule JOB_RESTART from SERVICE_AUTO_RESTART state
David Ward
david.ward at ll.mit.edu
Mon Apr 2 20:45:35 PDT 2012
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45511
---
src/service.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/service.c b/src/service.c
index 8b5c0b0..4bf6684 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2208,9 +2208,10 @@ 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 here so that those job
+ * dependencies will be added. */
+ if ((r = manager_add_job(UNIT(s)->manager, JOB_RESTART, UNIT(s), JOB_FAIL, false, &error, NULL)) < 0)
goto fail;
log_debug("%s scheduled restart job.", UNIT(s)->id);
--
1.7.1
More information about the systemd-devel
mailing list