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

DEFAULT_HOSTNAME= in os-release is not set when Hostname= is set #2673

Open
septatrix opened this issue May 1, 2024 · 3 comments
Open

DEFAULT_HOSTNAME= in os-release is not set when Hostname= is set #2673

septatrix opened this issue May 1, 2024 · 3 comments
Labels

Comments

@septatrix
Copy link
Contributor

mkosi commit the issue has been seen with

main

Used host distribution

Fedora 40

Used target distribution

Fedora 40

Linux kernel version used

6.8.7-300.fc40.x86_64

CPU architectures issue was seen on

x86_64

Unexpected behaviour you saw

On a usr/-only build the hostname reverted to "fedora" after losing a DHCP lease which assigned a hostname instead of the hostname set during image build by mkosi. See systemd/systemd#32541

As there is only one level of transient hostname "storage" there is no way to get the original hostname back afterwards. Therefore the only fallback possible is to use the default hostname from os-release (or the one compiled during systemd build). mkosi should therefore also update that variable to ensure the expected behavior.

Used mkosi config

No response

mkosi output

No response

@septatrix septatrix added the bug label May 1, 2024
@behrmann
Copy link
Contributor

behrmann commented May 1, 2024

Reading the linked issue I'm not sure setting the DEFAULT_HOSTNAME is something we should always do unconditionally, since it then would put the burden on people do remove that from the os-release file, if they don't want it and it doesn't seem like something that warrants an extra option. It might be something that's best left documented as is with a hint to use a script to change the os-release file.

@septatrix
Copy link
Contributor Author

I see no scenario where people would have to remove that line. If people are already setting Hostname= they expect the machine to have a certain hostname. So if the hostname is reset after losing a DHCP lease it makes way more sense to have that set as the Fallback instead of whatever the distribution usually ships

@DaanDeMeyer
Copy link
Contributor

Turning this into an RFE as I don't think this is necessarily a bug

@DaanDeMeyer DaanDeMeyer added RFE and removed bug labels May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants