Systemd service race causes incorrect hostname on Amazon Linux 2 #9506
Labels
AWS
Issues with AWS plugins or experienced by users running on AWS
exempt-stale
status: waiting-for-triage
Bug Report
Describe the bug
init/systemd.in
contains this:Unfortunately, Amazon Linux 2 still uses an old
hostnamectl
invocation like so:This is a race condition; often times if not virtually always, fluentd starts before
hostnamectl
can do its thing, and any output specifiers that contain${HOSTNAME}
end up with an incorrect value.To Reproduce
https://packages.fluentbit.io/amazonlinux/2/
${HOSTNAME}
in it:s3_key_format /logs/%Y/%m/%d/%H/$TAG/${HOSTNAME}/$UUID.log.gz
Expected behavior
${HOSTNAME}
should match the hostname configured byhostnamectl
Additional context
I worked around this by adding this to
/etc/systemd/system/fluent-bit.service.d/override.conf
:But I don't think folks should have to do that :(
The text was updated successfully, but these errors were encountered: