service: delay automatic restart if job is pending

This commit is contained in:
Lennart Poettering 2010-11-01 17:50:43 +01:00
parent 52da68821b
commit 2edfa36685
2 changed files with 7 additions and 2 deletions

2
TODO
View File

@ -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:

View 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)