diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-08-30 21:31:40 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-08-30 23:03:58 +0200 |
commit | b2bb3dbed9607c440b1a9ccacc515e28136d39ae (patch) | |
tree | 12bfdedab82abacb60ba3fe1e1a9e46989dc4785 /src/manager.c | |
parent | 1ceec64c089c796028716c3ef9721ed0f0399569 (diff) |
console: rework automatic getty on kernel console logic again
It is essential that the gettys are proper dependencies from
getty.target so that they aren't killed and immediately restarted on
runlevel changes. Hence rework the logic to implicitly add console
gettys to getty.target as dependencies.
This also adds an automatic hvc console for virtualizers.
https://bugzilla.redhat.com/show_bug.cgi?id=501720
Diffstat (limited to 'src/manager.c')
-rw-r--r-- | src/manager.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/manager.c b/src/manager.c index 09b2c789ed..0afc99243e 100644 --- a/src/manager.c +++ b/src/manager.c @@ -112,6 +112,8 @@ static int manager_setup_notify(Manager *m) { if (!(m->notify_socket = strdup(sa.un.sun_path+1))) return -ENOMEM; + log_debug("Using notification socket %s", m->notify_socket); + return 0; } @@ -447,6 +449,7 @@ void manager_free(Manager *m) { #endif free(m->notify_socket); + free(m->console); lookup_paths_free(&m->lookup_paths); strv_free(m->environment); @@ -2553,6 +2556,22 @@ void manager_reset_maintenance(Manager *m) { unit_reset_maintenance(u); } +int manager_set_console(Manager *m, const char *console) { + char *c; + + assert(m); + + if (!(c = strdup(console))) + return -ENOMEM; + + free(m->console); + m->console = c; + + log_debug("Using kernel console %s", c); + + return 0; +} + static const char* const manager_running_as_table[_MANAGER_RUNNING_AS_MAX] = { [MANAGER_SYSTEM] = "system", [MANAGER_SESSION] = "session" |