summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-10-20 00:56:26 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-20 00:56:26 +0200
commitdcdf86bbb07de0022d48e1c3d3941cc7ac12d138 (patch)
treea82b44bd14525f86e4f34cc3647eb98dcbc2025b
parentdc8e15c206ace4f9b424ea6c114a2bc7ee127eab (diff)
log: reopen console so that we have logging on shutdown
-rw-r--r--src/log.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/log.c b/src/log.c
index d82747ea8c..575ed51de1 100644
--- a/src/log.c
+++ b/src/log.c
@@ -212,6 +212,9 @@ int log_open(void) {
}
log_close_syslog();
+
+ /* Get the real /dev/console if we are PID=1, hence reopen */
+ log_close_console();
return log_open_console();
}
@@ -519,10 +522,9 @@ void log_parse_environment(void) {
if (log_show_color_from_string(e) < 0)
log_warning("Failed to parse bool %s. Ignoring.", e);
- if ((e = getenv("SYSTEMD_LOG_LOCATION"))) {
+ if ((e = getenv("SYSTEMD_LOG_LOCATION")))
if (log_show_location_from_string(e) < 0)
log_warning("Failed to parse bool %s. Ignoring.", e);
- }
}
LogTarget log_get_target(void) {