} else {
DBusError error;
Unit *target = NULL;
+ Job *default_unit_job;
dbus_error_init(&error);
manager_dump_units(m, stdout, "\t");
}
- if ((r = manager_add_job(m, JOB_START, target, JOB_REPLACE, false, &error, NULL)) < 0) {
+ r = manager_add_job(m, JOB_START, target, JOB_REPLACE, false, &error, &default_unit_job);
+ if (r < 0) {
log_error("Failed to start default target: %s", bus_error(&error, r));
dbus_error_free(&error);
goto finish;
}
+ m->default_unit_job_id = default_unit_job->id;
after_startup = now(CLOCK_MONOTONIC);
log_full(arg_action == ACTION_TEST ? LOG_INFO : LOG_DEBUG,
assert(m);
/* Is the initial job still around? */
- if (manager_get_job(m, 1))
+ if (manager_get_job(m, m->default_unit_job_id))
return true;
/* Is there a job for the shutdown target? */
int32_t subscribed_data_slot;
uint32_t current_job_id;
+ uint32_t default_unit_job_id;
/* Data specific to the Automount subsystem */
int dev_autofs_fd;