简体   繁体   English

如何永久更改linux printk日志级别?

[英]How to permanently change linux printk log level?

I have to run the following command every time when the system is rebooted, in order to get boot time log level changed to level 3: 每次重新启动系统时,我都必须运行以下命令,以便将启动时间日志级别更改为级别3:

cat /proc/sys/kernel/printk
7 4 1 7
echo "7 4 1 3">/proc/sys/kernel/printk

My question is: is there any way I can get the boot time log level set to 3 permanently instead of changing it every time after reboot? 我的问题是:有没有什么方法可以将启动时间日志级别永久设置为3而不是每次重启后都更改它?

只需将以下行附加到/etc/sysctl.conf文件:

kernel.printk = 7 4 1 3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM