X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fjob.c;h=bf1d95690824818c593ff900a55ab479d40746d2;hb=da7e457c5b9339721454ae8401a03ffdd781e6a9;hp=af5855b71d6a9c840c94b7cef7e55ee40d877c95;hpb=b92bea5d2a9481de69bb627a7b442a9f58fca43d;p=elogind.git diff --git a/src/core/job.c b/src/core/job.c index af5855b71..bf1d95690 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -35,7 +35,7 @@ #include "log.h" #include "dbus-job.h" #include "special.h" -#include "sync.h" +#include "async.h" #include "virt.h" JobBusClient* job_bus_client_new(DBusConnection *connection, const char *name) { @@ -569,7 +569,7 @@ int job_run_and_invalidate(Job *j) { return r; } -static const char *job_get_status_message_format(Unit *u, JobType t, JobResult result) { +_pure_ static const char *job_get_status_message_format(Unit *u, JobType t, JobResult result) { const UnitStatusMessageFormats *format_table; assert(u); @@ -588,7 +588,7 @@ static const char *job_get_status_message_format(Unit *u, JobType t, JobResult r return NULL; } -static const char *job_get_status_message_format_try_harder(Unit *u, JobType t, JobResult result) { +_pure_ static const char *job_get_status_message_format_try_harder(Unit *u, JobType t, JobResult result) { const char *format; assert(u); @@ -840,9 +840,11 @@ int job_finish_and_invalidate(Job *j, JobResult result, bool recursive) { job_result_to_string(result), NULL); - unit_trigger_on_failure(u); + unit_start_on_failure(u); } + unit_trigger_notify(u); + finish: /* Try to start the next jobs that can be started */ SET_FOREACH(other, u->dependencies[UNIT_AFTER], i) @@ -1086,10 +1088,13 @@ void job_shutdown_magic(Job *j) { * asynchronous sync() would cause their exit to be * delayed. */ - if (!unit_has_name(j->unit, SPECIAL_SHUTDOWN_TARGET)) + if (j->type != JOB_START) return; - if (j->type != JOB_START) + if (j->unit->manager->running_as != SYSTEMD_SYSTEM) + return; + + if (!unit_has_name(j->unit, SPECIAL_SHUTDOWN_TARGET)) return; if (detect_container(NULL) > 0)