diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-08-22 18:07:18 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-08-22 18:10:31 +0200 |
commit | d81afec1c9bf4b73e3df8996d65ecae95d19b6db (patch) | |
tree | 646681978c2238affa0fde7d66a0ad2d98d70bdf /src/core/manager.c | |
parent | f07756bfe25c64119704c93a634162d6c88b5c89 (diff) |
core: split up "starting" manager state into "initializing" and "starting"
We'll stay in "initializing" until basic.target has reached, at which
point we will enter "starting".
This is preparation so that we can change the startip timeout to only
apply to the first phase of startup, not the full procedure.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r-- | src/core/manager.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index 7639aeef19..9abdf475cf 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -2837,7 +2837,7 @@ static bool manager_get_show_status(Manager *m) { if (m->no_console_output) return false; - if (!IN_SET(manager_state(m), MANAGER_STARTING, MANAGER_STOPPING)) + if (!IN_SET(manager_state(m), MANAGER_INITIALIZING, MANAGER_STARTING, MANAGER_STOPPING)) return false; if (m->show_status > 0) @@ -2928,8 +2928,14 @@ ManagerState manager_state(Manager *m) { assert(m); /* Did we ever finish booting? If not then we are still starting up */ - if (!dual_timestamp_is_set(&m->finish_timestamp)) + if (!dual_timestamp_is_set(&m->finish_timestamp)) { + + u = manager_get_unit(m, SPECIAL_BASIC_TARGET); + if (!u || !UNIT_IS_ACTIVE_OR_RELOADING(unit_active_state(u))) + return MANAGER_INITIALIZING; + return MANAGER_STARTING; + } /* Is the special shutdown target queued? If so, we are in shutdown state */ u = manager_get_unit(m, SPECIAL_SHUTDOWN_TARGET); @@ -2955,6 +2961,7 @@ ManagerState manager_state(Manager *m) { } static const char *const manager_state_table[_MANAGER_STATE_MAX] = { + [MANAGER_INITIALIZING] = "initializing", [MANAGER_STARTING] = "starting", [MANAGER_RUNNING] = "running", [MANAGER_DEGRADED] = "degraded", |