summaryrefslogtreecommitdiff
path: root/src/core/job.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-10-28 01:49:07 +0100
committerLennart Poettering <lennart@poettering.net>2014-10-28 02:19:55 +0100
commitf189ab18de69d3dee81117d7925fb370cd038f0f (patch)
tree49e5346670270801723ae7fecdf6413115826f93 /src/core/job.c
parentfa1b91632c5220e6589007af4cd573ca909f915a (diff)
downloadsystemd-f189ab18de69d3dee81117d7925fb370cd038f0f.tar.gz
job: optionally, when a job timeout is hit, also execute a failure action
Diffstat (limited to 'src/core/job.c')
-rw-r--r--src/core/job.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/job.c b/src/core/job.c
index ef5dbce1a3..aa205ba781 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -858,14 +858,18 @@ finish:
static int job_dispatch_timer(sd_event_source *s, uint64_t monotonic, void *userdata) {
Job *j = userdata;
+ Unit *u;
assert(j);
assert(s == j->timer_event_source);
- log_warning_unit(j->unit->id, "Job %s/%s timed out.",
- j->unit->id, job_type_to_string(j->type));
+ log_warning_unit(j->unit->id, "Job %s/%s timed out.", j->unit->id, job_type_to_string(j->type));
+ u = j->unit;
job_finish_and_invalidate(j, JOB_TIMEOUT, true);
+
+ failure_action(u->manager, u->job_timeout_action, u->job_timeout_reboot_arg);
+
return 0;
}