Blocking call in phosphor-networkd

Patrick Williams patrick at stwcx.xyz
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/base-files_3.0.14.bb:hostname = "${MACHINE}"
poky/meta/recipes-core/base-files/base-files_3.0.14.bb:         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: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20221018/953dacf5/attachment.sig>


More information about the openbmc mailing list