/var/log/cloud-init-output.log is not present on RHEL 7.5

醉酒当歌 提交于 2019-12-14 03:45:25

问题


I've got a custom hardended RHEL 7.5 custom AMI. I want to use user data to complete some deploy time configuration. I've already ensured that /var/lib/cloud/* is removed before I create the AMI.

These are the contents of my user data: echo "My script fired." >> /tmp/test.txt echo "This line should produce an output log."

The file /tmp/test.txt is present, indicating the my script did indeed run. However, the expected result of the second statement is that a file /var/log/cloud-init-output.log should be produced in accordance with the AWS docs. This file is not present.

How do I make sure that user data produces the expected output log file?


回答1:


It appears that Red Hat felt the file was "completely unnecessary": https://bugzilla.redhat.com/show_bug.cgi?id=1424612

In order to view user data output, journalctl logs will need to be grepped:

sudo grep cloud-init /var/log/messages



来源:https://stackoverflow.com/questions/50255413/var-log-cloud-init-output-log-is-not-present-on-rhel-7-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!