diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-07-07 00:00:59 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-07-07 00:00:59 +0200 |
commit | 9e58ff9c5c3bd46a796a20fc6c304cdab489f334 (patch) | |
tree | 3bdef2c8802ee1b1deab9729b4f198fdfb2780f1 /src/manager.c | |
parent | fa0f4d8a3a640b235f12e9eb998ce726495622c1 (diff) |
manager: optionally print status updates to console on boot
Diffstat (limited to 'src/manager.c')
-rw-r--r-- | src/manager.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/manager.c b/src/manager.c index 6e571ea8b5..e19bacfa74 100644 --- a/src/manager.c +++ b/src/manager.c @@ -182,7 +182,7 @@ static int manager_setup_signals(Manager *m) { return 0; } -int manager_new(ManagerRunningAs running_as, bool confirm_spawn, Manager **_m) { +int manager_new(ManagerRunningAs running_as, Manager **_m) { Manager *m; int r = -ENOMEM; char *p; @@ -197,7 +197,6 @@ int manager_new(ManagerRunningAs running_as, bool confirm_spawn, Manager **_m) { dual_timestamp_get(&m->startup_timestamp); m->running_as = running_as; - m->confirm_spawn = confirm_spawn; m->name_data_slot = m->subscribed_data_slot = -1; m->exit_code = _MANAGER_EXIT_CODE_INVALID; m->pin_cgroupfs_fd = -1; @@ -2336,6 +2335,22 @@ finish: return r; } +bool manager_is_booting_or_shutting_down(Manager *m) { + Unit *u; + + assert(m); + + /* Is the initial job still around? */ + if (manager_get_job(m, 1)) + return true; + + /* Is there a job for the shutdown target? */ + if (((u = manager_get_unit(m, SPECIAL_SHUTDOWN_TARGET)))) + return !!u->meta.job; + + return false; +} + static const char* const manager_running_as_table[_MANAGER_RUNNING_AS_MAX] = { [MANAGER_SYSTEM] = "system", [MANAGER_SESSION] = "session" |