]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/hostname/hostnamed.c
Allow the fallback hostname to be overriden using an environment variable
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 15 Feb 2021 10:50:55 +0000 (11:50 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 22 Feb 2021 19:10:55 +0000 (20:10 +0100)
commit05c6f341b1fc18f59293d115bb4cbee94f8bf3a1
tree8897db9c1fa8b9b30dac251744b7d31b75988779
parent209c14705d5ea84aeaa597662af70d65edcc0231
Allow the fallback hostname to be overriden using an environment variable

See https://bugzilla.redhat.com/show_bug.cgi?id=1893417 for the back story:
the fallback hostname matters a lot in certain environments. Right now the only
way to configure the fallback hostname is by recompiling systemd, which is
obviously problematic in case when the fallback hostname shall differ between
different editions of the same distro that share a single compiled rpm.

By making this overridable through an envvar, we're providing an escape hatch
without making this a top-level api. Later on a way to set this through
os-release is added, but I think the approach with the variable is still
useful. It it very convenient for testing, or to override settings only in a
particular service, etc.
docs/ENVIRONMENT.md
src/basic/hostname-util.c
src/basic/hostname-util.h
src/hostname/hostnamed.c
src/resolve/resolved-manager.c
src/shared/hostname-setup.c
src/test/test-hostname-util.c