From: bl33pbl0p Date: Wed, 16 Jan 2019 00:03:22 +0000 (+0000) Subject: Log the job being merged X-Git-Tag: v241-rc1~63 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=28d78d07261bdfebbf36f7136bbb0d0f5f2029f1;p=thirdparty%2Fsystemd.git Log the job being merged Makes it easier to understand what was merged (and easier to realize why). Example is a start job running, and another unit triggering a verify-active job. It is not clear what job was it that from baz.service that merged into the installed job for bar.service in the debug logs. This makes it useful when debugging issues. Jan 15 11:45:58 jupiter systemd[1218]: baz.service: Trying to enqueue job baz.service/start/replace Jan 15 11:45:58 jupiter systemd[1218]: baz.service: Installed new job baz.service/start as 498 Jan 15 11:45:58 jupiter systemd[1218]: bar.service: Merged into installed job bar.service/start as 497 Jan 15 11:45:58 jupiter systemd[1218]: baz.service: Enqueued job baz.service/start as 498 It becomes: Jan 15 11:45:58 jupiter systemd[1218]: bar.service: Merged bar.service/verify-active into installed job bar.service/start as 497 --- diff --git a/src/core/job.c b/src/core/job.c index f635b7e933a..5210ac1ea0b 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -206,8 +206,9 @@ Job* job_install(Job *j) { (job_type_allows_late_merge(j->type) && job_type_is_superset(uj->type, j->type))) { job_merge_into_installed(uj, j); log_unit_debug(uj->unit, - "Merged into installed job %s/%s as %u", - uj->unit->id, job_type_to_string(uj->type), (unsigned) uj->id); + "Merged %s/%s into installed job %s/%s as %"PRIu32, + j->unit->id, job_type_to_string(j->type), uj->unit->id, + job_type_to_string(uj->type), uj->id); return uj; } else { /* already running and not safe to merge into */ @@ -216,8 +217,8 @@ Job* job_install(Job *j) { * not currently possible to have more than one installed job per unit. */ job_merge_into_installed(uj, j); log_unit_debug(uj->unit, - "Merged into running job, re-running: %s/%s as %u", - uj->unit->id, job_type_to_string(uj->type), (unsigned) uj->id); + "Merged into running job, re-running: %s/%s as %"PRIu32, + uj->unit->id, job_type_to_string(uj->type), uj->id); job_set_state(uj, JOB_WAITING); return uj;