From 3a9530e5f19565a9cadb7f20bd987c61e0e7c377 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 7 May 2018 18:37:32 +0200 Subject: nspawn: make the hostname of the container explicitly configurable with a new --hostname= switch Previously, the container's hostname was exclusively initialized from the machine name configured with --machine=, i.e. the internal name and the external name used for and by the container was synchronized. This adds a new option --hostname= that optionally allows the internal name to deviate from the external name. This new option is mainly useful to ultimately implement the OCI runtime spec directly in nspawn, but it might be useful on its own for some other usecases too. --- man/systemd-nspawn.xml | 16 ++++++++++++++++ man/systemd.nspawn.xml | 9 +++++++++ 2 files changed, 25 insertions(+) (limited to 'man') diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml index c6b027c58f..16d65d2b29 100644 --- a/man/systemd-nspawn.xml +++ b/man/systemd-nspawn.xml @@ -373,6 +373,22 @@ instead. + + + + Controls the hostname to set within the container, if different from the machine name. Expects + a valid hostname as argument. If this option is used, the kernel hostname of the container will be set to this + value, otherwise it will be initialized to the machine name as controlled by the + option described above. The machine name is used for various aspect of identification of the container from the + outside, the kernel hostname configurable with this option is useful for the container to identify itself from + the inside. It is usually a good idea to keep both forms of identification synchronized, in order to avoid + confusion. It is hence recommended to avoid usage of this option, and use + exclusively. Note that regardless whether the container's hostname is initialized from the name set with + or the one set with , the container can later override + its kernel hostname freely on its own as well. + + + diff --git a/man/systemd.nspawn.xml b/man/systemd.nspawn.xml index 6bd7b33b34..3f8c325fd9 100644 --- a/man/systemd.nspawn.xml +++ b/man/systemd.nspawn.xml @@ -302,6 +302,15 @@ details. + + Hostname= + + Configures the kernel hostname set for the container. This is equivalent to the + command line switch, and takes the same argument. See + systemd-nspawn1 for + details. + + -- cgit v1.2.3