]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: when we can't enqueue OnFailure= job show full error message
authorLennart Poettering <lennart@poettering.net>
Fri, 1 Jun 2018 17:04:37 +0000 (19:04 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 1 Jun 2018 17:04:37 +0000 (19:04 +0200)
Let's ask for the full error message and show it, there's really no
reason to just show the crappy errno error.

src/core/unit.c

index 2567365937f5dc13705e245dda46fec1498e3c3e..693d726922b5b1da3f05ee1a13a691d6f08537e8 100644 (file)
@@ -2126,6 +2126,7 @@ void unit_start_on_failure(Unit *u) {
         Unit *other;
         Iterator i;
         void *v;
+        int r;
 
         assert(u);
 
@@ -2135,11 +2136,11 @@ void unit_start_on_failure(Unit *u) {
         log_unit_info(u, "Triggering OnFailure= dependencies.");
 
         HASHMAP_FOREACH_KEY(v, other, u->dependencies[UNIT_ON_FAILURE], i) {
-                int r;
+                _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
 
-                r = manager_add_job(u->manager, JOB_START, other, u->on_failure_job_mode, NULL, NULL);
+                r = manager_add_job(u->manager, JOB_START, other, u->on_failure_job_mode, &error, NULL);
                 if (r < 0)
-                        log_unit_error_errno(u, r, "Failed to enqueue OnFailure= job: %m");
+                        log_unit_warning_errno(u, r, "Failed to enqueue OnFailure= job, ignoring: %s", bus_error_message(&error, r));
         }
 }