Page MenuHomeVyOS Platform

Static-host-mappings disappear from /etc/hosts after a while
Closed, ResolvedPublicBUG

Description

How to reproduce:

  • Setup system static-host-mapping:
set system static-host-mapping host-name panda alias 'panda.lab.local'
set system static-host-mapping host-name panda inet '192.168.101.109'
set system static-host-mapping host-name koala alias 'koala.lab.local'
set system static-host-mapping host-name koala inet '192.168.101.101'
set system static-host-mapping host-name tapir alias 'tapir.lab.local'
set system static-host-mapping host-name tapir inet '192.168.101.107'
commit && save
  • Verify change in /etc/hosts:
vyos@vyos:~$ grep -A3 static /etc/hosts
# static hostname mappings
192.168.101.109	panda.lab.local	panda
192.168.101.101	koala.lab.local	koala
192.168.101.107	tapir.lab.local	tapir
  • After a while (~45-50 minutes) the static hostname mappings disappear from /etc/hosts:
vyos@vyos:~$ grep -A3 static /etc/hosts
# static hostname mappings

### modifications from other scripts should be added below

Observation:

  • The disappearance correlates with this log entry from dbus:
Jul 23 09:15:16 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 09:15:16 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
  • Dbus entries in /var/log/messages appear 2 times every hour:
Jul 23 00:11:19 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 00:11:19 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 00:53:53 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 00:53:53 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 01:15:54 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 01:15:54 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 01:49:44 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 01:49:44 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 02:15:57 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 02:15:57 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 02:51:19 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 02:51:20 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 03:18:19 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 03:18:19 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 03:53:26 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 03:53:26 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 04:16:27 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 04:16:27 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 04:55:16 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 04:55:16 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 05:14:44 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 05:14:44 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 05:50:50 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 05:50:50 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 06:16:43 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 06:16:43 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 06:54:43 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 06:54:43 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 07:14:19 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 07:14:19 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 07:48:44 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 07:48:44 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 08:13:31 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 08:13:31 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 23 08:52:32 vyos dbus[1015]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Jul 23 08:52:32 vyos dbus[1015]: [system] Successfully activated service 'org.freedesktop.hostname1'
  • Possible regression since in Crux (Stable 1.2.1) host-name and alias are reversed

Crux -> 'host-name' = <FQDN> 'alias' = <ALIAS>
Rolling -> 'host-name' = <ALIAS> 'alias' = <FQDN>

Using the boot config from Crux produces the following static hostame mappings in /etc/hosts:

# static hostname mappings
192.168.101.109	panda	panda.lab.local
192.168.101.101	koala	koala.lab.local
192.168.101.107	tapir	tapir.lab.local

Details

Difficulty level
Unknown (require assessment)
Version
1.2.0-rolling+201907220337
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)