mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-03 13:47:04 +03:00
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.
This commit is contained in:
parent
f07756bfe2
commit
d81afec1c9
@ -300,7 +300,7 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha
|
||||
char buf[MAX(DECIMAL_STR_MAX(unsigned long), DECIMAL_STR_MAX(usec_t)) + 1];
|
||||
|
||||
sprintf(buf, "%lu\n",
|
||||
state == MANAGER_STARTING && c->startup_cpu_shares != (unsigned long) -1 ? c->startup_cpu_shares :
|
||||
IN_SET(state, MANAGER_STARTING, MANAGER_INITIALIZING) && c->startup_cpu_shares != (unsigned long) -1 ? c->startup_cpu_shares :
|
||||
c->cpu_shares != (unsigned long) -1 ? c->cpu_shares : 1024);
|
||||
r = cg_set_attribute("cpu", path, "cpu.shares", buf);
|
||||
if (r < 0)
|
||||
@ -328,7 +328,7 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha
|
||||
CGroupBlockIODeviceBandwidth *b;
|
||||
|
||||
if (!is_root) {
|
||||
sprintf(buf, "%lu\n", state == MANAGER_STARTING && c->startup_blockio_weight != (unsigned long) -1 ? c->startup_blockio_weight :
|
||||
sprintf(buf, "%lu\n", IN_SET(state, MANAGER_STARTING, MANAGER_INITIALIZING) && c->startup_blockio_weight != (unsigned long) -1 ? c->startup_blockio_weight :
|
||||
c->blockio_weight != (unsigned long) -1 ? c->blockio_weight : 1000);
|
||||
r = cg_set_attribute("blkio", path, "blkio.weight", buf);
|
||||
if (r < 0)
|
||||
|
@ -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",
|
||||
|
@ -38,6 +38,7 @@
|
||||
typedef struct Manager Manager;
|
||||
|
||||
typedef enum ManagerState {
|
||||
MANAGER_INITIALIZING,
|
||||
MANAGER_STARTING,
|
||||
MANAGER_RUNNING,
|
||||
MANAGER_DEGRADED,
|
||||
|
Loading…
x
Reference in New Issue
Block a user