如何在 CoreOS/Container Linux 上删除"更新策略:不重新启动"消息?



我在 CoreOS 上运行一个 Kubernetes 集群,并使用 coreos/container-linux-update-operator 以受控方式更新每个节点。但是,当我ssh其中一个节点时,我收到消息Update Strategy: No Reboots,大概是因为我已经禁用并屏蔽了locksmithd.service(因为它不再需要(。

如何阻止该消息显示?这实际上不是真的,因为update-operator正在处理更新。

此消息是在运行/etc/profile.d/coreos-profile.sh时生成的。 /etc/profile.d/coreos-profile.sh是指向/usr/share/baselayout/coreos-profile.sh的符号链接,您应该能够删除符号链接以禁用该消息。

请注意,此文件还运行此代码以在登录时显示失败单元的列表。

FAILED=$(systemctl list-units --state=failed --no-legend)
if [[ ! -z "${FAILED}" ]]; then
    COUNT=$(wc -l <<<"${FAILED}")
    echo -e "Failed Units: 33[31m${COUNT}33[39m"
    awk '{ print "  " $1 }' <<<"${FAILED}"
fi

如果这是一个显示障碍,您可以将此功能复制到其他脚本中/etc/profile.d/

您可以通过查看包含许多脚本和配置文件的基本布局存储库来发现很多关于 CoreOS 容器 linux 的信息 https://github.com/coreos/baselayout。你可以在这里找到有问题的脚本:https://github.com/coreos/baselayout/blob/master/baselayout/coreos-profile.sh 和用于生成符号链接的配置:https://github.com/coreos/baselayout/blob/master/tmpfiles.d/baselayout-etc.conf<</p>

div class="one_answers">

这个问题在 github 上有一个悬而未决的问题 https://github.com/coreos/bugs/issues/1968

最新更新