31 lines
1.0 KiB
Diff
31 lines
1.0 KiB
Diff
|
|
From 2a646b1d624e510a79785e1268b55a9c3a441db5 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Einsler Lee <shenxiaogll@163.com>
|
||
|
|
Date: Tue, 2 Mar 2021 20:21:21 +0800
|
||
|
|
Subject: [PATCH] main: reopen /dev/console for user service manager
|
||
|
|
|
||
|
|
Now the console_fd of user service manager is 2. Even if LogTarget=console is set in /etc/systemd/user.conf,there is no log in the console.
|
||
|
|
This reopen the /dev/console, so the log of user service can be output in the console.
|
||
|
|
|
||
|
|
Conflict:NA
|
||
|
|
Reference:https://github.com/systemd/systemd/commit/2a646b1d624e510a79785e1268b55a9c3a441db5
|
||
|
|
|
||
|
|
---
|
||
|
|
src/core/main.c | 1 +
|
||
|
|
1 file changed, 1 insertion(+)
|
||
|
|
|
||
|
|
diff --git a/src/core/main.c b/src/core/main.c
|
||
|
|
index 55f5481eb2..fbbfd71ac8 100644
|
||
|
|
--- a/src/core/main.c
|
||
|
|
+++ b/src/core/main.c
|
||
|
|
@@ -2819,6 +2819,7 @@ int main(int argc, char *argv[]) {
|
||
|
|
} else {
|
||
|
|
/* Running as user instance */
|
||
|
|
arg_system = false;
|
||
|
|
+ log_set_always_reopen_console(true);
|
||
|
|
log_set_target(LOG_TARGET_AUTO);
|
||
|
|
log_open();
|
||
|
|
|
||
|
|
--
|
||
|
|
2.33.0
|
||
|
|
|