Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wait for hostname to be available before starting
When telegraf starts with localhost.localdomain as the hostname, it sticks with that hostname even after the hostname changes later on. This happens mostly during server startup. Posting points with localhost.localdomain messes up lot of monitoring aspects. On systemd-networkd based systems, the following link explains how to make a systemd service start after the interface is fully setup. (refer https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/) But using repeated experiments it was confirmed that those steps do not work reliably. There are reports from other users about network-online.target not behaving as expected. See https://community.getchannels.com/t/wait-for-networking-on-reboot-ubuntu-network-online-target/936 So we are using a simple and yet gauranteed workaround suggested in coreos/bugs#1966 Repeated testing on ce114 confirmed that this method is completely reliable. This issue is avoided in dhclient based systems since we rely on dhclient helper to delay start telegraf. However, we could use the same change on dhclient based systems too if needed.
- Loading branch information