<div dir="ltr"><div dir="ltr">On Mon, Apr 20, 2020 at 6:17 PM Thomas HUMMEL <<a href="mailto:thomas.hummel@pasteur.fr">thomas.hummel@pasteur.fr</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">1. why does the transient hostname change while I stated --static only <br>
while running hostnamectl ?<br>
<br>
2. why does the change take some time to appear on dbus ?<br></blockquote><div><br></div><div>Hostnamed does not implement receiving hostname change notifications from the kernel, so it always reports you the same hostname that it has seen on startup.</div><div><br></div><div>You're only seeing changes because hostnamed <i>exits when idle</i> -- the next time you're actually talking to a brand new instance of hostnamed, which has seen the new hostname.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
3. what is supposed to happen the other way around ? i.e. if I change <br>
the transient hostname (hostname(1) command or writing to <br>
/proc/sys/kernel/hostname) : is dbus/hostnamectl supposed to see the <br>
change ? When and how ?<br></blockquote><div><br></div><div>In theory, hostnamed should be waiting for <a href="https://git.kernel.org/linus/f1ecf06854a66ee663f4d4cf029c78cd62a15e04">poll()</a> on /proc/sys/kernel/hostname. If hostnamed is running when the change happens, it should receive an event through epoll and re-read the hostname. (If hostnamed is *not* running, it will simply re-read the hostname on startup and no special events are needed.)</div><div><br></div><div>In practice, hostnamed does not do that (although several other systemd daemons do). It was probably forgotten to implement.</div><div><br></div><div>D-Bus doesn't care about hostnames; it's just a message bus.</div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>