diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-01-28 18:49:59 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-01-28 18:49:59 +0100 |
commit | f0469b8c4abbeee9ca69678245cd08314adc24c0 (patch) | |
tree | 19a349c961cfaed93d0e7c98f8555776173c4ad6 /src/core/manager.c | |
parent | 3282591dc30b2934a895c7403d2f0b0690260947 (diff) |
core: when determining system state, don't bother with JOB_TRY_RESTART
When we determine the current system state we check whether units like emergency.target are running or a job that
results in them being run is queued. However, this is not the case for JOB_TRY_RESTART, since that's a NOP if the unit
has not been running before. Hence, don't bother with checking for that job type.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r-- | src/core/manager.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index a83a8b013a..e8fea376ff 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -3097,18 +3097,18 @@ ManagerState manager_state(Manager *m) { /* Is the special shutdown target queued? If so, we are in shutdown state */ u = manager_get_unit(m, SPECIAL_SHUTDOWN_TARGET); - if (u && u->job && IN_SET(u->job->type, JOB_START, JOB_RESTART, JOB_TRY_RESTART, JOB_RELOAD_OR_START)) + if (u && u->job && IN_SET(u->job->type, JOB_START, JOB_RESTART, JOB_RELOAD_OR_START)) return MANAGER_STOPPING; /* Are the rescue or emergency targets active or queued? If so we are in maintenance state */ u = manager_get_unit(m, SPECIAL_RESCUE_TARGET); if (u && (UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(u)) || - (u->job && IN_SET(u->job->type, JOB_START, JOB_RESTART, JOB_TRY_RESTART, JOB_RELOAD_OR_START)))) + (u->job && IN_SET(u->job->type, JOB_START, JOB_RESTART, JOB_RELOAD_OR_START)))) return MANAGER_MAINTENANCE; u = manager_get_unit(m, SPECIAL_EMERGENCY_TARGET); if (u && (UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(u)) || - (u->job && IN_SET(u->job->type, JOB_START, JOB_RESTART, JOB_TRY_RESTART, JOB_RELOAD_OR_START)))) + (u->job && IN_SET(u->job->type, JOB_START, JOB_RESTART, JOB_RELOAD_OR_START)))) return MANAGER_MAINTENANCE; /* Are there any failed units? If so, we are in degraded mode */ |