/var/log/cloud-init-output.log在RHEL 7.5上不存在 [英] /var/log/cloud-init-output.log is not present on RHEL 7.5

查看:114
本文介绍了/var/log/cloud-init-output.log在RHEL 7.5上不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义的强化RHEL 7.5自定义AMI。我想使用用户数据来完成一些部署时间配置。我已经确保在创建AMI之前先删除 / var / lib / cloud / *

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.

这些是我的用户数据的内容:

echo我的脚本被解雇了。 >> /tmp/test.txt
echo此行应产生输出日志。

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

文件 /tmp/test.txt 存在,表明我的脚本确实运行了。但是,第二个语句的预期结果是应该生成文件 /var/log/cloud-init-output.log 根据AWS文档。此文件不存在。

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?

推荐答案

Red Hat似乎认为该文件完全不必要: https://bugzilla.redhat.com/show_bug.cgi?id=1424612

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

为了查看用户数据输出, journalctl 日志将需要被删除:

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

sudo grep cloud-init / var / log /邮件

这篇关于/var/log/cloud-init-output.log在RHEL 7.5上不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆