main: log to the console in a container
This commit is contained in:
+1
-1
@@ -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 */
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user