Hey!
Sending host-name option through DHCP is mostly ignored due to how hostname.sh works:
- OpenBMC boots
- dhclient gets its DHCP lease containing a
host-name option
- dhclient-script sets the hostname using the
hostname command
hostname.sh overrides the hostname with either bmc-oob or with hostname stored in /mnt/data/hostname and store the result in /mnt/data/hostname.
Also, if there is no network connectivity on boot:
- OpenBMC boots
- dhclient is unable to get a lease and will go on background
hostname.sh will sets and store it in /mnt/data/hostname
- network connectivity comes back
- dhclient gets a lease and host-name
dhclient-script won't update the hostname as one is already set
In case systemd is used, this is the same logic in networkd, except the hostname seems to be set even when a hostname already is set (I didn't test).
I would suggest to not change hostname if one already exists (as per hostname command). This wouldn't solve the second case, except with systemd.
Hey!
Sending
host-nameoption through DHCP is mostly ignored due to howhostname.shworks:host-nameoptionhostnamecommandhostname.shoverrides the hostname with eitherbmc-oobor with hostname stored in/mnt/data/hostnameand store the result in/mnt/data/hostname.Also, if there is no network connectivity on boot:
hostname.shwill sets and store it in/mnt/data/hostnamedhclient-scriptwon't update the hostname as one is already setIn case systemd is used, this is the same logic in networkd, except the hostname seems to be set even when a hostname already is set (I didn't test).
I would suggest to not change hostname if one already exists (as per
hostnamecommand). This wouldn't solve the second case, except with systemd.