job_free(j);
if (!success)
- unit_status_printf(u, "Starting %s... " ANSI_HIGHLIGHT_ON "failed" ANSI_HIGHLIGHT_OFF ".\n", unit_description(u));
+ unit_status_printf(u, "Starting %s " ANSI_HIGHLIGHT_ON "failed" ANSI_HIGHLIGHT_OFF ".\n", unit_description(u));
/* Fail depending jobs on failure */
if (!success) {
case JOB_RESTART:
case JOB_TRY_RESTART:
- if (ns == UNIT_INACTIVE)
+ if (ns == UNIT_INACTIVE || ns == UNIT_MAINTENANCE)
job_finish_and_invalidate(u->meta.job, true);
- else if (ns == UNIT_MAINTENANCE)
- job_finish_and_invalidate(u->meta.job, false);
else if (u->meta.job->state == JOB_RUNNING && ns != UNIT_DEACTIVATING) {
unexpected = true;
job_finish_and_invalidate(u->meta.job, false);