From: Lennart Poettering Date: Thu, 24 Feb 2011 01:41:34 +0000 (+0100) Subject: job: start job timeout on enqueuing not when we start to process a job X-Git-Tag: v19~19 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=312732cfaf63b463b2062c47fddb2d639a5fe635;p=systemd job: start job timeout on enqueuing not when we start to process a job This practically reverses 23e1e0c4a3bc93fb841ac9575953ed5d0ef5282d. This makes it easier to timeout individual jobs so that this timeout can be relied on, since blocked dependencies will not influence the timeout. --- diff --git a/src/job.c b/src/job.c index 53c47d4a..74702047 100644 --- a/src/job.c +++ b/src/job.c @@ -461,8 +461,6 @@ int job_run_and_invalidate(Job *j) { j->state = JOB_WAITING; else if (r < 0) r = job_finish_and_invalidate(j, JOB_FAILED); - else - job_start_timer(j); } return r; diff --git a/src/manager.c b/src/manager.c index 6759bbac..f266aaa0 100644 --- a/src/manager.c +++ b/src/manager.c @@ -1216,6 +1216,7 @@ static int transaction_apply(Manager *m) { job_add_to_run_queue(j); job_add_to_dbus_queue(j); + job_start_timer(j); log_debug("Installed new job %s/%s as %u", j->unit->meta.id, job_type_to_string(j->type), (unsigned) j->id); }