Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set hostname through DHCP #140

Open
vincentbernat opened this issue Nov 19, 2020 · 1 comment
Open

Unable to set hostname through DHCP #140

vincentbernat opened this issue Nov 19, 2020 · 1 comment

Comments

@vincentbernat
Copy link

Hey!

Sending host-name option through DHCP is mostly ignored due to how hostname.sh works:

  1. OpenBMC boots
  2. dhclient gets its DHCP lease containing a host-name option
  3. dhclient-script sets the hostname using the hostname command
  4. 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:

  1. OpenBMC boots
  2. dhclient is unable to get a lease and will go on background
  3. hostname.sh will sets and store it in /mnt/data/hostname
  4. network connectivity comes back
  5. dhclient gets a lease and host-name
  6. 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.

@Armodes
Copy link

Armodes commented Feb 5, 2021

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants