summaryrefslogtreecommitdiff
path: root/src/job.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/job.c')
-rw-r--r--src/job.c100
1 files changed, 50 insertions, 50 deletions
diff --git a/src/job.c b/src/job.c
index 85f2deed47..e57286fe89 100644
--- a/src/job.c
+++ b/src/job.c
@@ -62,8 +62,8 @@ void job_free(Job *j) {
if (j->installed) {
bus_job_send_removed_signal(j);
- if (j->unit->meta.job == j) {
- j->unit->meta.job = NULL;
+ if (j->unit->job == j) {
+ j->unit->job = NULL;
unit_add_to_gc_queue(j->unit);
}
@@ -147,7 +147,7 @@ void job_dump(Job *j, FILE*f, const char *prefix) {
"%s\tState: %s\n"
"%s\tForced: %s\n",
prefix, j->id,
- prefix, j->unit->meta.id, job_type_to_string(j->type),
+ prefix, j->unit->id, job_type_to_string(j->type),
prefix, job_state_to_string(j->state),
prefix, yes_no(j->override));
}
@@ -326,19 +326,19 @@ bool job_is_runnable(Job *j) {
* dependencies, regardless whether they are
* starting or stopping something. */
- SET_FOREACH(other, j->unit->meta.dependencies[UNIT_AFTER], i)
- if (other->meta.job)
+ SET_FOREACH(other, j->unit->dependencies[UNIT_AFTER], i)
+ if (other->job)
return false;
}
/* Also, if something else is being stopped and we should
* change state after it, then lets wait. */
- SET_FOREACH(other, j->unit->meta.dependencies[UNIT_BEFORE], i)
- if (other->meta.job &&
- (other->meta.job->type == JOB_STOP ||
- other->meta.job->type == JOB_RESTART ||
- other->meta.job->type == JOB_TRY_RESTART))
+ SET_FOREACH(other, j->unit->dependencies[UNIT_BEFORE], i)
+ if (other->job &&
+ (other->job->type == JOB_STOP ||
+ other->job->type == JOB_RESTART ||
+ other->job->type == JOB_TRY_RESTART))
return false;
/* This means that for a service a and a service b where b
@@ -489,7 +489,7 @@ static void job_print_status_message(Unit *u, JobType t, JobResult result) {
case JOB_FAILED:
unit_status_printf(u, ANSI_HIGHLIGHT_RED_ON "FAILED" ANSI_HIGHLIGHT_OFF, "Failed to start %s", unit_description(u));
- unit_status_printf(u, NULL, "See 'systemctl status %s' for details.", u->meta.id);
+ unit_status_printf(u, NULL, "See 'systemctl status %s' for details.", u->id);
break;
case JOB_DEPENDENCY:
@@ -539,8 +539,8 @@ int job_finish_and_invalidate(Job *j, JobResult result) {
if (result == JOB_DONE && (j->type == JOB_RESTART || j->type == JOB_TRY_RESTART)) {
log_debug("Converting job %s/%s -> %s/%s",
- j->unit->meta.id, job_type_to_string(j->type),
- j->unit->meta.id, job_type_to_string(JOB_START));
+ j->unit->id, job_type_to_string(j->type),
+ j->unit->id, job_type_to_string(JOB_START));
j->state = JOB_WAITING;
j->type = JOB_START;
@@ -553,7 +553,7 @@ int job_finish_and_invalidate(Job *j, JobResult result) {
j->result = result;
- log_debug("Job %s/%s finished, result=%s", j->unit->meta.id, job_type_to_string(j->type), job_result_to_string(result));
+ log_debug("Job %s/%s finished, result=%s", j->unit->id, job_type_to_string(j->type), job_result_to_string(result));
if (result == JOB_FAILED)
j->manager->n_failed_jobs ++;
@@ -571,42 +571,42 @@ int job_finish_and_invalidate(Job *j, JobResult result) {
t == JOB_VERIFY_ACTIVE ||
t == JOB_RELOAD_OR_START) {
- SET_FOREACH(other, u->meta.dependencies[UNIT_REQUIRED_BY], i)
- if (other->meta.job &&
- (other->meta.job->type == JOB_START ||
- other->meta.job->type == JOB_VERIFY_ACTIVE ||
- other->meta.job->type == JOB_RELOAD_OR_START)) {
- job_finish_and_invalidate(other->meta.job, JOB_DEPENDENCY);
+ SET_FOREACH(other, u->dependencies[UNIT_REQUIRED_BY], i)
+ if (other->job &&
+ (other->job->type == JOB_START ||
+ other->job->type == JOB_VERIFY_ACTIVE ||
+ other->job->type == JOB_RELOAD_OR_START)) {
+ job_finish_and_invalidate(other->job, JOB_DEPENDENCY);
recursed = true;
}
- SET_FOREACH(other, u->meta.dependencies[UNIT_BOUND_BY], i)
- if (other->meta.job &&
- (other->meta.job->type == JOB_START ||
- other->meta.job->type == JOB_VERIFY_ACTIVE ||
- other->meta.job->type == JOB_RELOAD_OR_START)) {
- job_finish_and_invalidate(other->meta.job, JOB_DEPENDENCY);
+ SET_FOREACH(other, u->dependencies[UNIT_BOUND_BY], i)
+ if (other->job &&
+ (other->job->type == JOB_START ||
+ other->job->type == JOB_VERIFY_ACTIVE ||
+ other->job->type == JOB_RELOAD_OR_START)) {
+ job_finish_and_invalidate(other->job, JOB_DEPENDENCY);
recursed = true;
}
- SET_FOREACH(other, u->meta.dependencies[UNIT_REQUIRED_BY_OVERRIDABLE], i)
- if (other->meta.job &&
- !other->meta.job->override &&
- (other->meta.job->type == JOB_START ||
- other->meta.job->type == JOB_VERIFY_ACTIVE ||
- other->meta.job->type == JOB_RELOAD_OR_START)) {
- job_finish_and_invalidate(other->meta.job, JOB_DEPENDENCY);
+ SET_FOREACH(other, u->dependencies[UNIT_REQUIRED_BY_OVERRIDABLE], i)
+ if (other->job &&
+ !other->job->override &&
+ (other->job->type == JOB_START ||
+ other->job->type == JOB_VERIFY_ACTIVE ||
+ other->job->type == JOB_RELOAD_OR_START)) {
+ job_finish_and_invalidate(other->job, JOB_DEPENDENCY);
recursed = true;
}
} else if (t == JOB_STOP) {
- SET_FOREACH(other, u->meta.dependencies[UNIT_CONFLICTED_BY], i)
- if (other->meta.job &&
- (other->meta.job->type == JOB_START ||
- other->meta.job->type == JOB_VERIFY_ACTIVE ||
- other->meta.job->type == JOB_RELOAD_OR_START)) {
- job_finish_and_invalidate(other->meta.job, JOB_DEPENDENCY);
+ SET_FOREACH(other, u->dependencies[UNIT_CONFLICTED_BY], i)
+ if (other->job &&
+ (other->job->type == JOB_START ||
+ other->job->type == JOB_VERIFY_ACTIVE ||
+ other->job->type == JOB_RELOAD_OR_START)) {
+ job_finish_and_invalidate(other->job, JOB_DEPENDENCY);
recursed = true;
}
}
@@ -618,7 +618,7 @@ int job_finish_and_invalidate(Job *j, JobResult result) {
* unit itself. */
if (result == JOB_TIMEOUT || result == JOB_DEPENDENCY) {
log_notice("Job %s/%s failed with result '%s'.",
- u->meta.id,
+ u->id,
job_type_to_string(t),
job_result_to_string(result));
@@ -627,14 +627,14 @@ int job_finish_and_invalidate(Job *j, JobResult result) {
finish:
/* Try to start the next jobs that can be started */
- SET_FOREACH(other, u->meta.dependencies[UNIT_AFTER], i)
- if (other->meta.job)
- job_add_to_run_queue(other->meta.job);
- SET_FOREACH(other, u->meta.dependencies[UNIT_BEFORE], i)
- if (other->meta.job)
- job_add_to_run_queue(other->meta.job);
+ SET_FOREACH(other, u->dependencies[UNIT_AFTER], i)
+ if (other->job)
+ job_add_to_run_queue(other->job);
+ SET_FOREACH(other, u->dependencies[UNIT_BEFORE], i)
+ if (other->job)
+ job_add_to_run_queue(other->job);
- manager_check_finished(u->meta.manager);
+ manager_check_finished(u->manager);
return recursed;
}
@@ -645,7 +645,7 @@ int job_start_timer(Job *j) {
int fd, r;
assert(j);
- if (j->unit->meta.job_timeout <= 0 ||
+ if (j->unit->job_timeout <= 0 ||
j->timer_watch.type == WATCH_JOB_TIMER)
return 0;
@@ -657,7 +657,7 @@ int job_start_timer(Job *j) {
}
zero(its);
- timespec_store(&its.it_value, j->unit->meta.job_timeout);
+ timespec_store(&its.it_value, j->unit->job_timeout);
if (timerfd_settime(fd, 0, &its, NULL) < 0) {
r = -errno;
@@ -727,7 +727,7 @@ void job_timer_event(Job *j, uint64_t n_elapsed, Watch *w) {
assert(j);
assert(w == &j->timer_watch);
- log_warning("Job %s/%s timed out.", j->unit->meta.id, job_type_to_string(j->type));
+ log_warning("Job %s/%s timed out.", j->unit->id, job_type_to_string(j->type));
job_finish_and_invalidate(j, JOB_TIMEOUT);
}