summaryrefslogtreecommitdiff
path: root/src/job.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/job.c')
-rw-r--r--src/job.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/job.c b/src/job.c
index 54c204b650..46577fdf7a 100644
--- a/src/job.c
+++ b/src/job.c
@@ -549,6 +549,13 @@ int job_finish_and_invalidate(Job *j, JobResult result) {
}
}
+ /* Trigger OnFailure dependencies that are not generated by
+ * the unit itself. We don't tread JOB_CANCELED as failure in
+ * this context. And JOB_FAILURE is already handled by the
+ * unit itself. */
+ if (result == JOB_TIMEOUT || result == JOB_DEPENDENCY)
+ unit_trigger_on_failure(u);
+
/* Try to start the next jobs that can be started */
SET_FOREACH(other, u->meta.dependencies[UNIT_AFTER], i)
if (other->meta.job)