chiark / gitweb /
hostnamed: Fix the way that static and transient host names interact
authorStef Walter <stef@thewalter.net>
Wed, 12 Feb 2014 08:46:31 +0000 (09:46 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 28 May 2014 01:34:37 +0000 (09:34 +0800)
commitc779a44222161155c039a7fd2fd304c006590ac7
treeeb41d945aef45f4b732b313754f33c507c3c05dc
parent76d4bef384ba8d1fbf1a8d44237012ce6292e519
hostnamed: Fix the way that static and transient host names interact

It is almost always incorrect to allow DHCP or other sources of
transient host names to override an explicitly configured static host
name.

This commit changes things so that if a static host name is set, this
will override the transient host name (eg: provided via DHCP). Transient
host names can still be used to provide host names for machines that have
not been explicitly configured with a static host name.

The exception to this rule is if the static host name is set to
"localhost". In those cases we act as if no
static host name has been explicitly set.

As discussed elsewhere, systemd may want to have an fd based ownership
of the transient name. That part is not included in this commit.
man/hostnamectl.xml
src/hostname/hostnamed.c