如何禁用 systemd 日志记录到控制台?

问题描述 投票:0回答:1

我在 Debian Jessie 中使用 systemd,systemd 在系统启动期间输出大量消息

Jul 27 00:13:18 Rastes systemd[1]: systemd-tmpfiles-clean.service: main process exited, code=exited, status=1/FAILURE
Jul 27 00:13:18 Rastes systemd[1]: Failed to start Cleanup of Temporary Directories.
Jul 27 00:13:18 Rastes systemd[1]: Unit systemd-tmpfiles-clean.service entered failed state.
Jul 28 00:13:58 Rastes systemd[1]: systemd-tmpfiles-clean.service: main process exited, code=exited, status=1/FAILURE
Jul 28 00:13:58 Rastes systemd[1]: Failed to start Cleanup of Temporary Directories.
Jul 28 00:13:58 Rastes systemd[1]: Unit systemd-tmpfiles-clean.service entered failed state.

我尝试将内核参数添加到 GRUB_CMDLINE_LINUX_DEFAULT 中,例如

systemd.log_target=/dev/null systemd.journald.forward_to_console=0 systemd.default_standard_output=null systemd.default_standard_error=null 

但 systemd 继续将日志输出到控制台。

如何关闭控制台登录?非常感谢。

linux logging systemd
1个回答
0
投票

您可以在journald.conf中关闭ForwardToConsole= (freedesktop.org/software/systemd/man/journald.conf.html)

© www.soinside.com 2019 - 2024. All rights reserved.