EC2 for RHEL 8.x にてboot.logにログを出力する方法

2021.05.11

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

こんにちは、テクニカルサポート(略してテクサポ!)の丸屋 正志(まるちゃん)です。

困っていた内容

/var/log/boot.log】 に出力されているログを活用したいのですが、そもそも 0Byte でログが出力されていないです。
どうしたら、【/var/log/boot.log】 にログが出力されますでしょうか?

どう対応すればいいの?

plymouth パッケージ の導入後に dracut コマンド等による initramfs の再生成が必要となります。
その後に、インスタンスの再起動をします。

対象インスタンスに接続後に、下記コマンドを実施してください。

$ sudo su -
# uname -r
4.18.0-147.el8.x86_64
# dnf install -y plymouth
# dracut -f
# reboot

再起動後...

$ sudo su -
# head /var/log/boot.log

------------ Tue May 10 12:45:05 UTC 2021 ------------

[  OK  ] Started Show Plymouth Boot Screen.
[  OK  ] Started Forward Password Requests to Plymouth Directory Watch.
[  OK  ] Reached target Paths.
[  OK  ] Reached target Local Encrypted Volumes.
[  OK  ] Reached target System Initialization.
[  OK  ] Reached target Basic System.
[  OK  ] Found device Amazon Elastic Block Store 2.
[  OK  ] Reached target Initrd Root Device.
[  OK  ] Started dracut initqueue hook.

参考資料