X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=job.c;h=148c7458b09fe2c32e719a028b94b760269cd718;hp=ff30864e438fd2a3e666babcc7057aae94c6a8a2;hb=f50e0a012340fa8dfe6ec7f0cd869f5f3a052d7a;hpb=b08d03ffe58332f590aae5c78a85e4fc0b8588ce diff --git a/job.c b/job.c index ff30864e4..148c7458b 100644 --- a/job.c +++ b/job.c @@ -5,6 +5,7 @@ #include "macro.h" #include "job.h" +#include "log.h" Job* job_new(Manager *m, JobType type, Unit *unit) { Job *j; @@ -405,10 +406,18 @@ int job_finish_and_invalidate(Job *j, bool success) { assert(j); assert(j->installed); + log_debug("Job %s/%s finished, success=%s", unit_id(j->unit), job_type_to_string(j->type), yes_no(success)); + /* Patch restart jobs so that they become normal start jobs */ if (success && (j->type == JOB_RESTART || j->type == JOB_TRY_RESTART)) { + + log_debug("Converting job %s/%s → %s/%s", + unit_id(j->unit), job_type_to_string(j->type), + unit_id(j->unit), job_type_to_string(JOB_START)); + j->state = JOB_RUNNING; j->type = JOB_START; + job_schedule_run(j); return 0; }