chiark / gitweb /
sysctl: use scandir() instead of nftw() to guarantee systematic ordering
[elogind.git] / src / job.c
index 54c204b650335ec9d35be6ff5db50d1e286c2c7b..54bd4147e293753dfae99e31c4c5309a98fbec87 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -101,7 +101,7 @@ JobDependency* job_dependency_new(Job *subject, Job *object, bool matters, bool
         /* Adds a new job link, which encodes that the 'subject' job
          * needs the 'object' job in some way. If 'subject' is NULL
          * this means the 'anchor' job (i.e. the one the user
-         * explcitily asked for) is the requester. */
+         * explicitly asked for) is the requester. */
 
         if (!(l = new0(JobDependency, 1)))
                 return NULL;
@@ -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)