-
Notifications
You must be signed in to change notification settings - Fork 292
CA-412636: hostname changed to localhost with static IP and reboot #6546
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
Conversation
I can't find commit 0307adc6, do you have the full git hash and title? |
5b54001
to
ce45a11
Compare
Sorry, I got the commit ID from wrong branch (my dev branch before merged to master), thus wrong commit id. |
So the approach of rewriting |
writing However, simply write to that file conflict with networkd, I may update later to call networkd to update the domain later, (update_config). but that will require more test. This PR overriding the hostname just follows what PBIS does, and it resolve the localhost issue. |
Aren't we going to regress the fix for XSI-1918 though? I'd rather wait until we have a fix that works for both CA-412636 and XSI-1918 and merge it in the same PR so we don't risk breaking AD for existing users. |
I am also confused about the relationship between the code that is removed and the new code - hence my question earlier. This PR should present more context how these problems are related. |
The deleted code does not fix XSI-1918.
The removed code does not have any issue as it was override by xcp-network anyway. (and It will not cause customer any trouble) |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, so this only partially reverts the previous change, in particular the resolv.conf update which introduced a bug as it conflicted with networkd, and in addition it sets the hostname using an external command.
According to https://www.freedesktop.org/software/systemd/man/latest/hostname.html Systemd set hostname with following sequence - kernel parameter, systemd.hostname - static hostname in /etc/hostname - transient hostname like DHCP - localhost at systemd compile time Once the host is configured with static IP and reboot, it would just lost its hostname as no DHCP or static IP available. However, the hostname is critical to AD function as it construct the machine account. The hostname should be persisted as static name during joining AD, this is also what PBIS does. Note: the static hostname is not cleaned during domain leave. This is by intention to avoid losing hostname after reboot with static IP cba2f1d tried to resovle the issue and update /etc/resolv.conf However, /etc/resolv.conf does not help and conflict with xcp-networkd, as networkd override the configure every 5 minutes Here we just revert the resolv.conf update. Other parts of that commit can still benifit as it push the hostname to DNS Signed-off-by: Lin Liu <[email protected]>
ce45a11
to
267c414
Compare
According to
https://www.freedesktop.org/software/systemd/man/latest/hostname.html Systemd set hostname with following sequence
Once the host is configured with static IP and reboot, it would just lost its hostname as no DHCP or static IP available.
However, the hostname is critical to AD function as it construct the machine account.
The hostname should be persisted as static name during joining AD, this is also what PBIS does.
Note: the static hostname is not cleaned during domain leave. This is by intention to avoid losing hostname after reboot with static IP
cba2f1d tried to resovle the issue and update /etc/resolv.conf However, /etc/resolv.conf does not help and conflict with xcp-networkd, as networkd override the configure every 5 minutes Here we just revert the resolv.conf update