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



On 4/27/20 7:05 PM, Thomas HUMMEL wrote:


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 ?

I actually did the test changing *only* the presence or absence of systemd-hostnamed (brutally renaming to systemd-hostnamed.service.orig in /usr/lib/systemd/system for the test) :

Each time withouth changing hostname-mode (directive was not there so its value is default) :

a) without systemd-hostnamed : short hostname
b) with systemd-hostnamed : fqdn

[again with an external tool issuing hostname(1) between dhcp and manual profile]

So it seems to me that, because of hostnamed lack of polling for transient hostname change, NetworkManager could behave differently according if this service it uses as a proxy is there or not (i.e. if NM reads directly using gethostname(3)) : the 'last hostname set outside of NetworkManager could vary.

What do you think ?

Note : this could be more complicated because, as systemd.hostnamed deactivates itsef when idle, I wonder if a fresh instance would not start by setting the transient hostname to the static hostname (which is quite the goal of the static hostname to me). So this would give another result if the get-hostname() waited a little more ?

Thanks

--
Thomas HUMMEL


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