From 90df7e567f668b4d0e7761fd15fa8cebffc759a0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 14 Mar 2011 04:48:14 +0100 Subject: main: log to the console in a container --- src/main.c | 2 +- src/nspawn.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index 313afcce16..0c805c98a9 100644 --- a/src/main.c +++ b/src/main.c @@ -1021,7 +1021,7 @@ int main(int argc, char *argv[]) { if (getpid() == 1) { arg_running_as = MANAGER_SYSTEM; - log_set_target(LOG_TARGET_SYSLOG_OR_KMSG); + log_set_target(detect_container(NULL) > 0 ? LOG_TARGET_CONSOLE : LOG_TARGET_SYSLOG_OR_KMSG); /* This might actually not return, but cause a * reexecution */ diff --git a/src/nspawn.c b/src/nspawn.c index 297bb61f63..f340805f38 100644 --- a/src/nspawn.c +++ b/src/nspawn.c @@ -254,7 +254,7 @@ static int copy_devnodes(const char *dest) { r = -errno; } - if (mount(from, to, "bind", MS_BIND, NULL) < 0) { + if (mount(from, to, "bind", MS_BIND|MS_RDONLY, NULL) < 0) { log_error("bind mount for /dev/console failed: %m"); if (r == 0) -- cgit v1.2.3-54-g00ecf