diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2016-08-04 13:45:49 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2016-08-04 13:50:13 +0000 |
commit | e1ac8c36854fbeb60a53a5090fbb673b2a7b9d09 (patch) | |
tree | cc969c8a612fe7412f9d14759e6dc64c77b2a5a1 /share | |
parent | Releasing debian version 20160701-1. (diff) | |
download | open-infrastructure-compute-tools-e1ac8c36854fbeb60a53a5090fbb673b2a7b9d09.tar.xz open-infrastructure-compute-tools-e1ac8c36854fbeb60a53a5090fbb673b2a7b9d09.zip |
Merging upstream version 20160801.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to '')
-rw-r--r-- | share/config/container.conf.in | 4 | ||||
-rw-r--r-- | share/doc/examples/cairon-backports.cfg | 1 | ||||
-rw-r--r-- | share/man/container-create.1.txt | 3 | ||||
-rw-r--r-- | share/man/container-enter.1.txt | 5 | ||||
-rw-r--r-- | share/man/container-remove.1.txt | 3 | ||||
-rw-r--r-- | share/man/container-start.1.txt | 3 | ||||
-rw-r--r-- | share/man/container-status.1.txt | 2 | ||||
-rw-r--r-- | share/man/container-tools.7.txt | 14 | ||||
-rw-r--r-- | share/man/container.1.txt | 3 | ||||
-rwxr-xr-x | share/scripts/debconf | 43 | ||||
-rwxr-xr-x | share/scripts/debconf.d/0003-debconf | 7 |
11 files changed, 70 insertions, 18 deletions
diff --git a/share/config/container.conf.in b/share/config/container.conf.in index dd52adb..b5678c0 100644 --- a/share/config/container.conf.in +++ b/share/config/container.conf.in @@ -3,14 +3,16 @@ [start] cnt.auto=@CNT_AUTO@ cnt.network-bridge=@CNT_NETWORK_BRIDGE@ +cnt.overlay=@CNT_OVERLAY@ bind=@BIND@ boot=@BOOT@ capability=@CAPABILITY@ directory=@DIRECTORY@ drop-capability=@DROP_CAPABILITY@ +link-journal=@LINK_JOURNAL@ machine=@MACHINE@ network-veth-extra=@NETWORK_VETH_EXTRA@ -link-journal=@LINK_JOURNAL@ +private-users=@PRIVATE_USERS@ register=@REGISTER@ [limit] diff --git a/share/doc/examples/cairon-backports.cfg b/share/doc/examples/cairon-backports.cfg index eed9fd6..8243bbc 100644 --- a/share/doc/examples/cairon-backports.cfg +++ b/share/doc/examples/cairon-backports.cfg @@ -64,4 +64,5 @@ container-tools cnt-debconf/nameserver/options string timeout:1 attempts:1 #container-tools cnt-debconf/container-command string #container-tools cnt-debconf/host-command string container-tools cnt-debconf/auto string FQDN +#container-tools cnt-debconf/overlay string #container-tools cnt-debconf/bind string diff --git a/share/man/container-create.1.txt b/share/man/container-create.1.txt index b7a4f01..4fe592f 100644 --- a/share/man/container-create.1.txt +++ b/share/man/container-create.1.txt @@ -56,6 +56,9 @@ The following container-create options are available: *-b, --bind='DIRECTORY:DIRECTORY[:OPTIONS][;DIRECTORY:DIRECTORY[:OPTIONS]]'*:: Specify container bind mounts, see systemd-nspawn(1) --bind option. +*--cnt-overlay='DIRECTORY_LOWER:DIRECTORY_UPPER:DIRECTORY_WORK:DIRECTORY_MERGED[;DIRECTORY_UPPER:DIRECTORY_LOWER:DIRECTORY_WORK:DIRECTORY_MERGED]'*:: + Specify container overlay mounts, see Documentation/filesystems/overlayfs.txt. + SCRIPTS ------- diff --git a/share/man/container-enter.1.txt b/share/man/container-enter.1.txt index 792cac7..61c0f66 100644 --- a/share/man/container-enter.1.txt +++ b/share/man/container-enter.1.txt @@ -29,7 +29,7 @@ container-enter - Enter a container namespace SYNOPSIS -------- -*container enter* ['OPTIONS'] [-- COMMAND|"COMMANDS"] +*container enter* ['OPTIONS'] DESCRIPTION @@ -50,9 +50,6 @@ EXAMPLES *Enter to example.net container namespace:*:: sudo container enter -n example.net -*Execute 'ip a' in example.net container namespace:*:: - sudo container enter -n example.net -- 'ip a' - SEE ALSO -------- diff --git a/share/man/container-remove.1.txt b/share/man/container-remove.1.txt index cb9b77f..cad779f 100644 --- a/share/man/container-remove.1.txt +++ b/share/man/container-remove.1.txt @@ -47,6 +47,9 @@ The following container options are available: *-f, --force*:: Do not prompt before removal. +*-v, --verbose*:: + Explain what is being done. + EXAMPLES -------- diff --git a/share/man/container-start.1.txt b/share/man/container-start.1.txt index 313587d..bf1d8de 100644 --- a/share/man/container-start.1.txt +++ b/share/man/container-start.1.txt @@ -44,6 +44,9 @@ The following container options are available: *-n, --name='NAME'*:: Specify container name. +*-f, --force'*:: + Removing stray lock file if existing. + EXAMPLES -------- diff --git a/share/man/container-status.1.txt b/share/man/container-status.1.txt index e5c700b..f1688dc 100644 --- a/share/man/container-status.1.txt +++ b/share/man/container-status.1.txt @@ -24,7 +24,7 @@ CONTAINER-STATUS(1) NAME ---- -container-status - Get the status of a container +container-status - Show container status SYNOPSIS diff --git a/share/man/container-tools.7.txt b/share/man/container-tools.7.txt index 7fd1a0f..604683f 100644 --- a/share/man/container-tools.7.txt +++ b/share/man/container-tools.7.txt @@ -87,30 +87,20 @@ USAGE *Start a container:*:: sudo container start -n NAME -*Restart a container:*:: - sudo container restart -n NAME - *Stop a container:*:: sudo container stop -n NAME *Remove a container:*:: sudo container remove -n NAME -*Attach console to a container:*:: - sudo container console -n NAME - -*Enter a container namespace:*:: - sudo container enter -n NAME - -*limit*:: - sudo container limit -n NAME --cpu-quota 10% - *List container on the system:*:: sudo container list *Show container-tools version:*:: container version +See container(1) for a list of all container commands. + LINKS ----- diff --git a/share/man/container.1.txt b/share/man/container.1.txt index d660379..32bd393 100644 --- a/share/man/container.1.txt +++ b/share/man/container.1.txt @@ -76,6 +76,9 @@ The following container commands are available: *list*:: List container on the system, see container-list(1). +*status*:: + Show container status, see container-status(1). + *version*:: Show container-tools version, see container-version(1). diff --git a/share/scripts/debconf b/share/scripts/debconf index aa1c798..4c89e6f 100755 --- a/share/scripts/debconf +++ b/share/scripts/debconf @@ -909,6 +909,7 @@ Commands () sed -i -e "s|^cnt.auto=.*|cnt.auto=${CNT_AUTO}|" "${CONFIG}/${NAME}.conf" sed -i -e "s|^cnt.network-bridge=.*|cnt.network-bridge=${HOST_INTERFACE_NAME}:${NETWORK0_BRIDGE:-br0}|g" "${CONFIG}/${NAME}.conf" + sed -i -e "s|^cnt.overlay=.*|cnt.overlay=${CNT_OVERLAY}|g" "${CONFIG}/${NAME}.conf" sed -i -e "s|^bind=.*|bind=${BIND}|" "${CONFIG}/${NAME}.conf" sed -i -e "s|^network-veth-extra=.*|network-veth-extra=${HOST_INTERFACE_NAME}:eth0|g" "${CONFIG}/${NAME}.conf" @@ -1010,12 +1011,54 @@ then done fi +# Mounting overlay mounts +if [ -n "${CNT_OVERLAY}" ] +then + CNT_OVERLAYS="$(echo ${CNT_OVERLAY} | sed -e 's|;| |g')" + + for CNT_OVERLAY in ${CNT_OVERLAYS} + do + DIRECTORY_LOWER="$(echo ${CNT_OVERLAY} | awk -F: '{ print $1 }')" + DIRECTORY_UPPER="$(echo ${CNT_OVERLAY} | awk -F: '{ print $2 }')" + DIRECTORY_WORK="$(echo ${CNT_OVERLAY} | awk -F: '{ print $3 }')" + DIRECTORY_MERGED="$(echo ${CNT_OVERLAY} | awk -F: '{ print $4 }')" + + for DIRECTORY in "${DIRECTORY_LOWER}" "${DIRECTORY_UPPER}" "${DIRECTORY_WORK}" "${DIRECTORY_MERGED}" + do + mkdir -p "${DIRECTORY}" + done + + mount -t overlay overlay-${NAME} -olowerdir="${DIRECTORY_LOWER}",upperdir="${DIRECTORY_UPPER}",workdir="${DIRECTORY_WORK}" "${DIRECTORY_MERGED}" + done +fi + Configure_system "${MACHINES}/${NAME}" Configure_network "${MACHINES}/${NAME}" Cleanup_system "${MACHINES}/${NAME}" Commands "${MACHINES}/${NAME}" +# Unmounting overlay mounts +if [ -n "${CNT_OVERLAY}" ] +then + CNT_OVERLAYS="$(echo ${CNT_OVERLAY} | sed -e 's|;| |g')" + + for CNT_OVERLAY in ${CNT_OVERLAYS} + do + DIRECTORY_LOWER="$(echo ${CNT_OVERLAY} | awk -F: '{ print $1 }')" + DIRECTORY_UPPER="$(echo ${CNT_OVERLAY} | awk -F: '{ print $2 }')" + DIRECTORY_WORK="$(echo ${CNT_OVERLAY} | awk -F: '{ print $3 }')" + DIRECTORY_MERGED="$(echo ${CNT_OVERLAY} | awk -F: '{ print $4 }')" + + umount -f "${DIRECTORY_MERGED}" + + for DIRECTORY in "${DIRECTORY_LOWER}" "${DIRECTORY_UPPER}" "${DIRECTORY_WORK}" "${DIRECTORY_MERGED}" + do + rmdir --ignore-fail-on-non-empty --parents ${DIRECTORY} > /dev/null 2>&1 || true + done + done +fi + # Unmounting bind mounts if [ -n "${BIND}" ] then diff --git a/share/scripts/debconf.d/0003-debconf b/share/scripts/debconf.d/0003-debconf index 15a6a15..548fb07 100755 --- a/share/scripts/debconf.d/0003-debconf +++ b/share/scripts/debconf.d/0003-debconf @@ -1063,6 +1063,13 @@ Internal_options () fi echo "BIND=\"${BIND}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + + if db_get cnt-debconf/overlay + then + CNT_OVERLAY="${RET}" # string (w/ empty) + fi + + echo "CNT_OVERLAY=\"${CNT_OVERLAY}\"" >> "${DEBCONF_TMPDIR}/debconf.default" } Distribution |