Systemd/src/hostname
Zbigniew Jędrzejewski-Szmek d39079fcaa hostnamed: stop discriminating against "localhost" in /etc/hostname
We would sometimes ignore localhost-style names in /etc/hostname. That is
brittle. If the user configured some hostname, it's most likely because they
want to use that as the hostname. If they don't want to use such a hostname,
they should just not create the config. Everything becomes simples if we just
use the configured hostname as-is.

This behaviour seems to have been a workaround for Anaconda installer and other
tools writing out /etc/hostname with the default of "localhost.localdomain".
Anaconda PR to stop doing that: https://github.com/rhinstaller/anaconda/pull/3040.
That might have been useful as a work-around for other programs misbehaving if
/etc/hostname was not present, but nowadays it's not useful because systemd
mostly controls the hostname and it is perfectly happy without that file.

Apart from making things simpler, this allows users to set a hostname like
"localhost" and have it honoured, if such a whim strikes them.
2020-12-16 11:02:18 +01:00
..
hostnamectl.c hostname-util: flagsify hostname_is_valid(), drop machine_name_is_valid() 2020-12-15 17:59:48 +01:00
hostnamed.c hostnamed: stop discriminating against "localhost" in /etc/hostname 2020-12-16 11:02:18 +01:00
meson.build license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
org.freedesktop.hostname1.conf license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
org.freedesktop.hostname1.policy license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
org.freedesktop.hostname1.service license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00