core: move service_unwatch_control_pid() call into service_enter_running()
authorLennart Poettering <lennart@poettering.net>
Wed, 3 Feb 2016 22:55:53 +0000 (23:55 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 3 Feb 2016 22:58:53 +0000 (23:58 +0100)
When we enter the running state we should forget about any control processes, in all cases, and not just when hit a
reload timeout...

src/core/service.c

index 4942fc4..8bfb9fe 100644 (file)
@@ -1635,6 +1635,8 @@ static void service_enter_running(Service *s, ServiceResult f) {
         if (f != SERVICE_SUCCESS)
                 s->result = f;
 
+        service_unwatch_control_pid(s);
+
         if (service_good(s)) {
 
                 /* If there are any queued up sd_notify()
@@ -2887,8 +2889,7 @@ static int service_dispatch_timer(sd_event_source *source, usec_t usec, void *us
                 break;
 
         case SERVICE_RELOAD:
-                log_unit_warning(UNIT(s), "Reload operation timed out. Stopping.");
-                service_unwatch_control_pid(s);
+                log_unit_warning(UNIT(s), "Reload operation timed out. Killing reload process.");
                 service_kill_control_processes(s);
                 s->reload_result = SERVICE_FAILURE_TIMEOUT;
                 service_enter_running(s, SERVICE_SUCCESS);