chiark / gitweb /
general: unify error code we generate on timeout
[elogind.git] / src / job.c
index 18a249592bbc193f1af7bbb5b5c6594e121b77b9..ec57144cb744743a2d3c8639814673cbdfca4688 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -309,8 +309,12 @@ bool job_is_runnable(Job *j) {
 
         /* Checks whether there is any job running for the units this
          * job needs to be running after (in the case of a 'positive'
-         * job type) or before (in the case of a 'negative' job type
-         * . */
+         * job type) or before (in the case of a 'negative' job
+         * type. */
+
+        /* First check if there is an override */
+        if (j->ignore_deps)
+                return true;
 
         if (j->type == JOB_START ||
             j->type == JOB_VERIFY_ACTIVE ||
@@ -372,6 +376,7 @@ int job_run_and_invalidate(Job *j) {
 
         j->state = JOB_RUNNING;
         job_add_to_dbus_queue(j);
+        job_start_timer(j);
 
         /* While we execute this operation the job might go away (for
          * example: because it is replaced by a new, conflicting
@@ -390,6 +395,7 @@ int job_run_and_invalidate(Job *j) {
                          * wait */
                         if (r == -EBADR)
                                 r = 0;
+
                         break;
 
                 case JOB_VERIFY_ACTIVE: {
@@ -667,7 +673,8 @@ DEFINE_STRING_TABLE_LOOKUP(job_type, JobType);
 static const char* const job_mode_table[_JOB_MODE_MAX] = {
         [JOB_FAIL] = "fail",
         [JOB_REPLACE] = "replace",
-        [JOB_ISOLATE] = "isolate"
+        [JOB_ISOLATE] = "isolate",
+        [JOB_IGNORE_DEPENDENCIES] = "ignore-dependencies"
 };
 
 DEFINE_STRING_TABLE_LOOKUP(job_mode, JobMode);