]> err.no Git - systemd/commitdiff
service: delay automatic restart if job is pending
authorLennart Poettering <lennart@poettering.net>
Mon, 1 Nov 2010 16:50:43 +0000 (17:50 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 10 Nov 2010 21:38:43 +0000 (22:38 +0100)
TODO
src/service.c

diff --git a/TODO b/TODO
index 8ae5fc5b3f2f8f83c81e11a26870610e72df4f92..a97ba9f16844a87777795aa8a347ce285ed871e1 100644 (file)
--- a/TODO
+++ b/TODO
@@ -74,8 +74,6 @@
 
 * we now order plymouth after udev-trigger. Can we optimize this?
 
-* disable respawn when we are going down anyway.
-
 * drop tmp.mount
 
 External:
index d3c750e5441b7def316c34105f4bf54f195800bf..0b54e5bfcfb760d6e09ccaa430faae0488573f57 100644 (file)
@@ -2039,6 +2039,13 @@ static void service_enter_restart(Service *s) {
         assert(s);
         dbus_error_init(&error);
 
+        if (s->meta.job) {
+                log_info("Job pending for unit, delaying automatic restart.");
+
+                if ((r = unit_watch_timer(UNIT(s), s->restart_usec, &s->timer_watch)) < 0)
+                        goto fail;
+        }
+
         service_enter_dead(s, true, false);
 
         if ((r = manager_add_job(s->meta.manager, JOB_START, UNIT(s), JOB_FAIL, false, &error, NULL)) < 0)