Hi,
Actually there are two problems happened here, but they are related.
This is log when I configured hostname:
[edit] vyos@test-1# set system host-name test-2 [edit] vyos@test-1# commit Message from root@test-1 on (none) at 13:41 ... Active configuration has been changed by user 'root' on '?'. Please make sure you do not have conflicting changes. You can also discard the current changes by issuing 'exit discard'. EOF [ system host-name test-2 ] Could not connect to vyos-hostsd [[]] failed Commit failed Failed to generate committed config [edit] vyos@test-1# commit No configuration changes to commit [edit] vyos@test-1# set system host-name test-2 DEBUG vexit_internal: calling getCompletionEnv() without config session DEBUG vexit_internal: calling getCompletionEnv() without config session DEBUG vexit_internal: calling getCompletionEnv() without config session [edit] vyos@test-1#
The hostname configuration failure is caused by vyos-hostsd, obviously, something failed and trigger that restart:
Dec 17 13:41:05 test-1 systemd[1]: vyos-hostsd.service: main process exited, code=exited, status=1/FAILURE Dec 17 13:41:05 test-1 systemd[1]: Unit vyos-hostsd.service entered failed state. Dec 17 13:41:05 test-1 systemd[1]: vyos-hostsd.service holdoff time over, scheduling restart. Dec 17 13:41:05 test-1 systemd[1]: Stopping VyOS DNS configuration keeper... Dec 17 13:41:05 test-1 systemd[1]: Starting VyOS DNS configuration keeper... Dec 17 13:41:05 test-1 systemd[1]: Started VyOS DNS configuration keeper.
I only can identify that the code reply_msg = self.__socket.recv().decode() in _communicate function of /usr/lib/python3/dist-packages/vyos/hostsd_client.py triggered the problem, maybe there was something wrong in socket communication between client and server, I'm not good at it, so please help to identify the root cause.
But if it's just about restart of vyos-hostsd, the log won't be like above. There is another consequent problem, at same time, the vyos-router service is restarted, actaully it's triggered by restart of vyos-hostsd. So all configuration is reloaded at that time.
Dec 17 13:41:05 test-1 systemd[1]: vyos-router.service: control process exited, code=exited status=127 Dec 17 13:41:05 test-1 systemd[1]: Unit vyos-router.service entered failed state. Dec 17 13:41:05 test-1 systemd[1]: Starting VyOS Router... Dec 17 13:41:05 test-1 systemd[1]: Started VyOS Router.
I checked /lib/systemd/system/vyos-hostsd.service, and found that they are dependency in service definition, I don't know if it's the cause and if it's on purpose. But I think it's not reasonable that restarting vyos-hostsd to trigger restarting of vyos-router which lead to many thing reconfigured unintentionally , it's very big impact.
[Install] RequiredBy=cloud-init-local.service vyos-router.service
best regards.