Re: hostname-mode : short vs fqdn name



On 4/17/20 10:23 PM, Beniamino Galvani wrote:

Hello Beniamino,

No, I don't think it does. I think that DHCP is run before NM,
probably in initrd or by other services.

Indeed, in between I came to a similar conclusion. And tracing further (helping my with NM dans my initrd sources) I figured out:

- the original hostname, which NM reads from dbus is indeed setup by dracut/initrd/dhclient-scripts

a) when no postcsript adding a second NM manual profile is not run, results and reasons are, as expected :

- hostname-mode == none : maestro-1000.maestro.pasteur.fr (original from initrd)

- hostname-mode == dhcp : maestro-1000 (from dhcp)

- hostname-mode == default : maestro-1000 (from dhcp)

b) when postscript, which adds to the nic a higher autoconnect priority manual ip address profile is run :

- hostname-mode == none : maestro-1000 (the postscript itself issues a hostname command - I missed that point initially)

- hostname-mode == dhcp : maestro-1000.maestro.pasteur.fr (reset from dhcp) : I guess it's when the dhcp profile is disconnected, original hostname is reset by NM as the semantic of hostname-mode=dhcp implies)

- hostname-mode == default : maestro-1000.maestro.pasteur.fr (fallback no default device) : again, semantics of hostname-mode
As a matter of fact in this case I see in this trace

http://dl.pasteur.fr/fop/JyY4sSwA/confignetwork-default.log.bz2

that default device setting occurs :

policy: set 'xcat-enp33s0f0' (enp33s0f0) as default for IPv4 routing and DNS

but *after*:

policy: set-hostname: set hostname to 'maestro-1000.maestro.pasteur.fr' (no default device)

I'm not really sure : is this is normal ?

So, this aside everything is indeed fully explained.

May I add 2 last questions though ?

1. as seen in this other trace

http://dl.pasteur.fr/fop/wRQfXSQX/confignetwork-none.log.bz2

why are they many lines *long after the dhcp + static profile scenario is "finished"* we can still see many lines such as

auth: call[XX]: CheckAuthorization
or
policy: set-hostname: hostname is unmanaged

?

2. this has nothing to do with NM and is not related to the initial thread (I just experienced it while debugging my case) but it seems that when, starting with no static hostname, we set one with hostnamectl --static set-hostname the transient hostname

- is also set to that name (seems to contredict the man for --static)
- *not immediatly* (I can still see for some time the original - different - transient name)

Does it seem legit to you ?

Thanks anyway for your help and time

Best,


--
TH



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