Re: systemd-hostnamed/hostnamectl and transient hostname change

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

 



On Mon, Apr 20, 2020 at 6:17 PM Thomas HUMMEL <thomas.hummel@xxxxxxxxxx> wrote:
1. why does the transient hostname change while I stated --static only
while running hostnamectl ?

2. why does the change take some time to appear on dbus ?

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.

You're only seeing changes because hostnamed exits when idle -- the next time you're actually talking to a brand new instance of hostnamed, which has seen the new hostname.
 

3. what is supposed to happen the other way around ? i.e. if I change
the transient hostname (hostname(1) command or writing to
/proc/sys/kernel/hostname) : is dbus/hostnamectl supposed to see the
change ? When and how ?

In theory, hostnamed should be waiting for poll() 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.)

In practice, hostnamed does not do that (although several other systemd daemons do). It was probably forgotten to implement.

D-Bus doesn't care about hostnames; it's just a message bus.

--
Mantas Mikulėnas
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux