summaryrefslogtreecommitdiff
path: root/src/job.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-01 00:31:53 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-01 00:31:53 +0200
commit6124958c7bda3fed9b079e8217781480797703f5 (patch)
tree7e5b47c29fa4c7cfe24c7798091d3561e3231cca /src/job.c
parent4fd5948e74b776b6d68ba55f558da5f354179e52 (diff)
unit: add new abstracted maintenance state for units
Diffstat (limited to 'src/job.c')
-rw-r--r--src/job.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/job.c b/src/job.c
index 78fe136328..8273a39c35 100644
--- a/src/job.c
+++ b/src/job.c
@@ -279,7 +279,8 @@ bool job_type_is_redundant(JobType a, UnitActiveState b) {
case JOB_STOP:
return
- b == UNIT_INACTIVE;
+ b == UNIT_INACTIVE ||
+ b == UNIT_INACTIVE_MAINTENANCE;
case JOB_VERIFY_ACTIVE:
return
@@ -415,7 +416,7 @@ int job_run_and_invalidate(Job *j) {
case JOB_RESTART: {
UnitActiveState t = unit_active_state(j->unit);
- if (t == UNIT_INACTIVE || t == UNIT_ACTIVATING) {
+ if (t == UNIT_INACTIVE || t == UNIT_INACTIVE_MAINTENANCE || t == UNIT_ACTIVATING) {
j->type = JOB_START;
r = unit_start(j->unit);
} else
@@ -425,7 +426,7 @@ int job_run_and_invalidate(Job *j) {
case JOB_TRY_RESTART: {
UnitActiveState t = unit_active_state(j->unit);
- if (t == UNIT_INACTIVE || t == UNIT_DEACTIVATING)
+ if (t == UNIT_INACTIVE || t == UNIT_INACTIVE_MAINTENANCE || t == UNIT_DEACTIVATING)
r = -ENOEXEC;
else if (t == UNIT_ACTIVATING) {
j->type = JOB_START;