When the VyOS has configured domain-name + preserve-fqdn option and the hostanme if changed after, the /var/log/messages displays the old hostname and not the changed one.
Apr 14 17:07:12 anyHostname.anydomain.es systemd-hostnamed[20865]: Hostname set to <NewHostName> (static) Apr 14 17:07:12 anyHostname.anydomain.es systemd[1]: Stopping System Logging Service...
Note in the next log the hostname remains as: anyHostname.anydomain.es instead of NewHostName. This is the minimum configuration to trigger the issue:
> set system syslog global preserve-fqdn > set system domain-name 'anydomain.es' > set system host-name 'anyHostname'
As long as the customer tries to change the hostname while the preserve-fqdn option is configured, it won't update the hostname in the logs, until it is deleted. In addition noticed when a hostname has configuerd a period (.) the hostname in the logs doesn't show completele, as the next example:
vyos@vyos# set system host-name hostname.with.period [edit] vyos@vyos# commit;save [edit] vyos@vyos# tail -f /var/log/messages Apr 14 17:39:32 hostname vyos-configd[701]: [system_host-name] Apr 14 17:39:32 hostname vyos-configd[701]: scripts_called: ['system_host-name'] Apr 14 17:39:32 hostname vyos-configd[701]: Sending reply: SUCCESS with output Apr 14 17:39:32 hostname systemd[1]: opt-vyatta-config-tmp-new_config_2943.mount: Deactivated successfully. Apr 14 17:39:32 hostname vyos-configd[701]: [system_host-name] Apr 14 17:39:32 hostname vyos-configd[701]: scripts_called: ['system_host-name'] Apr 14 17:39:32 hostname vyos-configd[701]: Sending reply: SUCCESS with output Apr 14 17:39:32 hostname systemd[1]: opt-vyatta-config-tmp-new_config_2943.mount: Deactivated successfully. Apr 14 17:39:34 hostname commit: Successful change to active configuration by user vyos on /dev/ttyS0 Apr 14 17:39:34 hostname commit[5231]: Successful change to active configuration by user vyos on /dev/ttyS0
Conclusion:
- If the customer then has syslog configured, these logs will show the same way in the syslog server, causing an hostanme issue.
Workaround
- Delete the preserve-fqdn option
- Then commit;save
- Change the hostname to the new one
- Configure preserve-fqdn option again.
- Then commit;save
Behavior has been tested for new LTS version 1.5 and 1.4.3 and 1.4.4.