Re: hostname-mode=default and hostname set outside NM



On 4/27/20 5:34 PM, Thomas HUMMEL wrote:
On 4/27/20 5:20 PM, Beniamino Galvani wrote:

It uses systemd-hostnamed, and falls back to gethostname() in case of
failure [1].
I should then try to remove hostnamed just to figure out why in

1) hostname from initrd : fqdn
2) NM starts : hostname-originial == fqdn
3) dhcp : short name
4) an external tool issues hostname <short name> and creates another higher priority NM profile

NM (hostname-mode=default) restores the fqdn (as seen in traces) instead of the short one in 3) which, according to what you just explained is the LAST externally set.

I'll try to figure out this myself...Thanks for your help.

Well, I was thinking about 4) :

hostname(1) says that hostname is set via sethostname(2). This is outside of NetworkManager but as it may also be outside systemd-hostnamed (hostname(1) was used and not hostnamectl or dbus-send) could that explain what I see ?

hostname(1) change the transient/kernel hostname but as systemd-hostnamed does not poll /proc/sys/kernel/hostname (which was confirmed to my in the systemd-devel list) for a change, this out-of-NM set hostname is not seen by NM, which then restores the last outside one seen BY himself, which is the hostname-original read from dbus at its start ?

Thanks

--
TH


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]