Blocking call in phosphor-networkd

Patrick Williams patrick at
Wed Oct 19 15:52:03 AEDT 2022

On Wed, Oct 19, 2022 at 11:40:17AM +0800, Lei Yu wrote:

> How about changing the code to read the `/etc/hostname` file directly?
> It is much faster than making DBus call to `systemd-hostnamed`.

Absolutely not.

The value of `/etc/hostname` is considered to be the "static hostname",
which is configured by default in the 'base-files' package to be the
value of ${MACHINE}:

poky/meta/recipes-core/base-files/ = "${MACHINE}"
poky/meta/recipes-core/base-files/         echo ${hostname} > ${D}${sysconfdir}/hostname

The value from the dbus call is the "transient hostname" which is
typically assigned by the DHCP server and is much much more likely to be
something that resolves properly on your network.  Since all the
machines of the same type will have the same static hostname (due to it
being derived from MACHINE) you are almost certain that this name is
useless for any purpose.

Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <>

More information about the openbmc mailing list