]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/service.c
Merge pull request #9158 from poettering/notify-auto-reload
[thirdparty/systemd.git] / src / core / service.c
index beae077a59cc4f2afeeeae0a4099f173c8537566..bd62fbce3a0e2a14c1cc2ce5d0cd1830326ddf0e 100644 (file)
@@ -1080,7 +1080,9 @@ static void service_set_state(Service *s, ServiceState state) {
         if (old_state != state)
                 log_unit_debug(UNIT(s), "Changed %s -> %s", service_state_to_string(old_state), service_state_to_string(state));
 
-        unit_notify(UNIT(s), table[old_state], table[state], s->reload_result == SERVICE_SUCCESS);
+        unit_notify(UNIT(s), table[old_state], table[state],
+                    (s->reload_result == SERVICE_SUCCESS ? 0 : UNIT_NOTIFY_RELOAD_FAILURE) |
+                    (s->will_auto_restart ? UNIT_NOTIFY_WILL_AUTO_RESTART : 0));
 }
 
 static usec_t service_coldplug_timeout(Service *s) {
@@ -1590,6 +1592,7 @@ static bool service_will_restart(Unit *u) {
                 return false;
         if (UNIT(s)->job->type == JOB_START)
                 return true;
+
         return false;
 }