summaryrefslogtreecommitdiffstats
path: root/lib/container/start
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-10-06 15:05:42 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2018-05-27 05:59:31 +0000
commit1e03e6dc46624f658239c3179875bd28b67fa91a (patch)
tree38731aa38565f40cb5419ea8e17af1af84f1f186 /lib/container/start
parentReleasing version 20180503. (diff)
downloadcompute-tools-1e03e6dc46624f658239c3179875bd28b67fa91a.tar.xz
compute-tools-1e03e6dc46624f658239c3179875bd28b67fa91a.zip
Switching to systemd-nspawn configuration files from /etc/container-tools/config.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'lib/container/start')
-rwxr-xr-xlib/container/start44
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/container/start b/lib/container/start
index e4b2ee6..6d43af8 100755
--- a/lib/container/start
+++ b/lib/container/start
@@ -22,7 +22,7 @@ set -e
COMMAND="$(basename ${0})"
-CONFIG="/etc/container-tools/config"
+CONFIG="/etc/systemd/nspawn"
HOOKS="/etc/container-tools/hooks"
MACHINES="/var/lib/machines"
@@ -175,9 +175,9 @@ case "${START}" in
esac
# config
-if [ -e "${CONFIG}/${NAME}.conf" ]
+if [ -e "${CONFIG}/${NAME}.nspawn" ]
then
- CNT_OVERLAY="$(awk -F= '/^cnt.overlay=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ CNT_OVERLAY="$(awk -F= '/^cnt.overlay=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
if [ -n "${CNT_OVERLAY}" ]
then
@@ -202,7 +202,7 @@ then
done
fi
- BIND="$(awk -F= '/^bind=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ BIND="$(awk -F= '/^bind=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
if [ -n "${BIND}" ]
then
@@ -227,7 +227,7 @@ then
done
fi
- BIND_RO="$(awk -F= '/^bind-ro=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ BIND_RO="$(awk -F= '/^bind-ro=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
if [ -n "${BIND_RO}" ]
then
@@ -252,7 +252,7 @@ then
done
fi
- BOOT="$(awk -F= '/^boot=/ { print $2 }' ${CONFIG}/${NAME}.conf || echo yes)"
+ BOOT="$(awk -F= '/^boot=/ { print $2 }' ${CONFIG}/${NAME}.nspawn || echo yes)"
case "${BOOT}" in
yes)
@@ -264,7 +264,7 @@ then
;;
esac
- CAPABILITY="$(awk -F= '/^capability=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ CAPABILITY="$(awk -F= '/^capability=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
case "${CAPABILITY}" in
"")
@@ -276,10 +276,10 @@ then
;;
esac
- DIRECTORY="$(awk -F= '/^directory=/ { print $2 }' ${CONFIG}/${NAME}.conf || echo ${MACHINES}/${NAMES})"
+ DIRECTORY="$(awk -F= '/^directory=/ { print $2 }' ${CONFIG}/${NAME}.nspawn || echo ${MACHINES}/${NAMES})"
DIRECTORY="--directory ${DIRECTORY}"
- DROP_CAPABILITY="$(awk -F= '/^drop-capability=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ DROP_CAPABILITY="$(awk -F= '/^drop-capability=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
case "${DROP_CAPABILITY}" in
"")
@@ -291,7 +291,7 @@ then
;;
esac
- LINK_JOURNAL="$(awk -F= '/^link-journal=/ { print $2 }' ${CONFIG}/${NAME}.conf || echo no)"
+ LINK_JOURNAL="$(awk -F= '/^link-journal=/ { print $2 }' ${CONFIG}/${NAME}.nspawn || echo no)"
case "${LINK_JOURNAL}" in
yes)
@@ -307,7 +307,7 @@ then
NETWORK_VETH_EXTRA=""
- VETHS="$(awk -F= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ VETHS="$(awk -F= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
case "${VETHS}" in
"")
@@ -327,7 +327,7 @@ then
;;
esac
- NETWORK_BRIDGES="$(awk -F= '/^cnt.network-bridge=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ NETWORK_BRIDGES="$(awk -F= '/^cnt.network-bridge=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
case "${NETWORK_BRIDGES}" in
"")
@@ -363,7 +363,7 @@ EOF
;;
esac
- PRIVATE_USERS="$(awk -F= '/^private-users=/ { print $2 }' ${CONFIG}/${NAME}.conf || echo no)"
+ PRIVATE_USERS="$(awk -F= '/^private-users=/ { print $2 }' ${CONFIG}/${NAME}.nspawn || echo no)"
case "${PRIVATE_USERS}" in
yes)
@@ -375,7 +375,7 @@ EOF
;;
esac
- REGISTER="$(awk -F= '/^register=/ { print $2 }' ${CONFIG}/${NAME}.conf || echo yes)"
+ REGISTER="$(awk -F= '/^register=/ { print $2 }' ${CONFIG}/${NAME}.nspawn || echo yes)"
case "${REGISTER}" in
yes)
@@ -387,7 +387,7 @@ EOF
;;
esac
- BLOCK_IO_DEVICE_WEIGHT="$(awk -F= '/^BlockIODeviceWeight=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ BLOCK_IO_DEVICE_WEIGHT="$(awk -F= '/^BlockIODeviceWeight=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
if [ -n "${BLOCK_IO_DEVICE_WEIGHT}" ]
then
@@ -395,7 +395,7 @@ EOF
SET_PROPERTY="true"
fi
- BLOCK_IO_READ_BANDWIDTH="$(awk -F= '/^BlockIOReadBandwidth=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ BLOCK_IO_READ_BANDWIDTH="$(awk -F= '/^BlockIOReadBandwidth=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
if [ -n "${BLOCK_IO_READ_BANDWIDTH}" ]
then
@@ -403,7 +403,7 @@ EOF
SET_PROPERTY="true"
fi
- BLOCK_IO_WEIGHT="$(awk -F= '/^BlockIOWeight=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ BLOCK_IO_WEIGHT="$(awk -F= '/^BlockIOWeight=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
if [ -n "${BLOCK_IO_WEIGHT}" ]
then
@@ -411,7 +411,7 @@ EOF
SET_PROPERTY="true"
fi
- BLOCK_IO_WRITE_BANDWIDTH="$(awk -F= '/^BlockIOWriteBandwidth=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ BLOCK_IO_WRITE_BANDWIDTH="$(awk -F= '/^BlockIOWriteBandwidth=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
if [ -n "${BLOCK_IO_WRITE_BANDWIDTH}" ]
then
@@ -419,7 +419,7 @@ EOF
SET_PROPERTY="true"
fi
- CPU_QUOTA="$(awk -F= '/^CPUQuota=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ CPU_QUOTA="$(awk -F= '/^CPUQuota=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
if [ -n "${CPU_QUOTA}" ]
then
@@ -427,7 +427,7 @@ EOF
SET_PROPERTY="true"
fi
- CPU_SHARES="$(awk -F= '/^CPUShares=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ CPU_SHARES="$(awk -F= '/^CPUShares=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
if [ -n "${CPU_SHARES}" ]
then
@@ -435,7 +435,7 @@ EOF
SET_PROPERTY="true"
fi
- MEMORY_LIMIT="$(awk -F= '/^MemoryLimit=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ MEMORY_LIMIT="$(awk -F= '/^MemoryLimit=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
if [ -n "${MEMORY_LIMIT}" ]
then
@@ -443,7 +443,7 @@ EOF
SET_PROPERTY="true"
fi
- TASKS_MAX="$(awk -F= '/^TasksMax=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ TASKS_MAX="$(awk -F= '/^TasksMax=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
if [ -n "${TASKS_MAX}" ]
then