summaryrefslogtreecommitdiff
path: root/src/core/job.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-27 00:59:08 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-27 01:23:16 -0500
commit2cba2e03524ec0922ddc70f933e8a89b7d23b4ec (patch)
tree715e583b85ca435c905432b5792e8449ce4bab5c /src/core/job.c
parent68db7a3bd9b2f8640c7297382b6d20eb995f7e1e (diff)
manager: print ephemeral information about running jobs' timeouts
Produces output like: [ *** ] (1 of 2) A start job is running for slow.service (33s / 1min 30s) The first nubmer is the time since job start, the second is the job timeout.
Diffstat (limited to 'src/core/job.c')
-rw-r--r--src/core/job.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/job.c b/src/core/job.c
index e6529b61e9..fb6709edf7 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -860,11 +860,14 @@ static int job_dispatch_timer(sd_event_source *s, uint64_t monotonic, void *user
int job_start_timer(Job *j) {
int r;
- if (j->unit->job_timeout <= 0 || j->timer_event_source)
+ if (j->timer_event_source)
return 0;
j->begin_usec = now(CLOCK_MONOTONIC);
+ if (j->unit->job_timeout <= 0)
+ return 0;
+
r = sd_event_add_monotonic(j->manager->event, j->begin_usec + j->unit->job_timeout, 0, job_dispatch_timer, j, &j->timer_event_source);
if (r < 0)
return r;