The /var/log/dmesg file is not created during boot for Red Hat Enterprise Linux 8
https://access.redhat.com/solutions/3748981
环境
- Red Hat Enterprise Linux 8
问题
- On boot, there is no /var/log/dmesg file after install RHEL8.
- I can get dmesg file via command dmesg, is this new design for RHEL 8, or do I need to modify some configuration to generate it automatically?
决议
Re-enabling the /var/log/dmesg log file
1) Create a /etc/systemd/system/dmesg.service configuration file with the following contents
[Unit]
Description=Create /var/log/dmesg on boot
ConditionPathExists=/var/log/dmesg
[Service]
ExecStart=/usr/bin/dmesg
StandardOutput=file:/var/log/dmesg
[Install]
WantedBy=multi-user.target
2) Create the /var/log/dmesg file and verify SELinux contexts
# touch /var/log/dmesg
# restorecon -v /var/log/dmesg
3) Enable the service to start on boot
# systemctl enable dmesg
本文介绍了解决Red Hat Enterprise Linux 8在启动时未创建dmesg日志文件的问题。通过创建dmesg.service配置文件并设置正确的SELinux上下文,可以确保在启动时自动生成dmesg日志。
2万+

被折叠的 条评论
为什么被折叠?



