From b9ba4dabbab8a58a044ec42655e11e65bd3ecc47 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 12 Dec 2014 17:26:31 +0100 Subject: nspawn: when booting in ephemeral mode, append random token to machine name Also, when booting up an ephemeral container of / use the system hostname as default machine name. This way specifiyng -M is unnecessary when booting up an ephemeral container, while allowing any number of ephemeral containers to run from the same tree. --- man/systemd-nspawn.xml | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'man') diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml index b66c34df01..d7d60e52c2 100644 --- a/man/systemd-nspawn.xml +++ b/man/systemd-nspawn.xml @@ -231,8 +231,10 @@ its root directory (as configured with ), that is removed immediately when the - container terminates. May not be - specified together with + container terminates. This option is + only supported if the root file system + is btrfs. May not + be specified together with or . @@ -303,13 +305,22 @@ Sets the machine name for this container. This name may be - used to identify this container on the - host, and is used to initialize the - container's hostname (which the - container can choose to override, - however). If not specified, the last - component of the root directory of the - container is used. + used to identify this container during + its runtime (for example in tools like + machinectl1 + and similar), and is used to + initialize the container's hostname + (which the container can choose to + override, however). If not specified, + the last component of the root + directory path of the container is + used, possibly suffixed with a random + identifier in case + mode is + selected. If the root directory + selected is the host's root directory + the host's hostname is used as default + instead. @@ -814,13 +825,16 @@ - Boot into a <literal>btrfs</literal> snapshot of the host system + Boot into an ephemeral <literal>btrfs</literal> snapshot of the host system - # btrfs subvolume snapshot / /.tmp -# systemd-nspawn --private-network -D /.tmp -b + # systemd-nspawn -D / -xb This runs a copy of the host system in a - btrfs snapshot. + btrfs snapshot which is + removed immediately when the container + exits. All file system changes made during + runtime will be lost on shutdown, + hence. @@ -847,7 +861,8 @@ debootstrap8, pacman8, systemd.slice5, - machinectl1 + machinectl1, + btrfs8 -- cgit v1.2.1