summaryrefslogtreecommitdiffstats
path: root/lib/container/limit
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2017-07-23 08:28:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2017-07-23 08:28:38 +0000
commit67dd59d5d9d8efb620ba8b65c7a661a8ae6a1365 (patch)
tree43300ba57e2427696d7d9b0b6ff14275d991f912 /lib/container/limit
parentAdding upstream version 20170701. (diff)
downloadopen-infrastructure-compute-tools-67dd59d5d9d8efb620ba8b65c7a661a8ae6a1365.tar.xz
open-infrastructure-compute-tools-67dd59d5d9d8efb620ba8b65c7a661a8ae6a1365.zip
Adding upstream version 20170722.upstream/20170722
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/container/limit')
-rwxr-xr-xlib/container/limit22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/container/limit b/lib/container/limit
index b888656..05bffdc 100755
--- a/lib/container/limit
+++ b/lib/container/limit
@@ -25,7 +25,7 @@ MACHINES="/var/lib/machines"
Parameters ()
{
- GETOPT_LONGOPTIONS="name:,blockio-device-weight:,blockio-read-bandwith:,blockio-weight:,blockio-write-bandwith:,cpu-quota:,cpu-shares:,memory-limit:,tasks-max:,"
+ GETOPT_LONGOPTIONS="name:,blockio-device-weight:,blockio-read-bandwidth:,blockio-weight:,blockio-write-bandwidth:,cpu-quota:,cpu-shares:,memory-limit:,tasks-max:,"
GETOPT_OPTIONS="n:b:c:m:t:,"
PARAMETERS="$(getopt --longoptions ${GETOPT_LONGOPTIONS} --name=${COMMAND} --options ${GETOPT_OPTIONS} --shell sh -- ${@})"
@@ -71,8 +71,8 @@ Parameters ()
shift 2
;;
- --blockio-read-bandwith)
- BLOCK_IO_READ_BANDWITH="${2}"
+ --blockio-read-bandwidth)
+ BLOCK_IO_READ_BANDWIDTH="${2}"
shift 2
;;
@@ -81,8 +81,8 @@ Parameters ()
shift 2
;;
- --blockio-write-bandwith)
- BLOCK_IO_WRITE_BANDWITH="${2}"
+ --blockio-write-bandwidth)
+ BLOCK_IO_WRITE_BANDWIDTH="${2}"
shift 2
;;
@@ -101,7 +101,7 @@ Parameters ()
Usage ()
{
- echo "Usage: container ${COMMAND} -n|--name NAME [--blockio-device-weight \"DEVICE WEIGHT\"] [--blockio-read-bandwith \"DEVICE BYTES\"] [-b|--blockio-weight WEIGHT] [--blockio-write-bandwith \"DEVICE BYTES\"] [-c|--cpu-quota QUOTA] [--cpu-shares SHARES] [-m|--memory-limit BYTES] [-t|--tasks-max NUMBER]" >&2
+ echo "Usage: container ${COMMAND} -n|--name NAME [--blockio-device-weight \"DEVICE WEIGHT\"] [--blockio-read-bandwidth \"DEVICE BYTES\"] [-b|--blockio-weight WEIGHT] [--blockio-write-bandwidth \"DEVICE BYTES\"] [-c|--cpu-quota QUOTA] [--cpu-shares SHARES] [-m|--memory-limit BYTES] [-t|--tasks-max NUMBER]" >&2
exit 1
}
@@ -136,9 +136,9 @@ then
SET_PROPERTY="true"
fi
-if [ -n "${BLOCK_IO_READ_BANDWITH}" ]
+if [ -n "${BLOCK_IO_READ_BANDWIDTH}" ]
then
- BLOCK_IO_READ_BANDWITH="BlockIOReadBandwidth=${BLOCK_IO_READ_BANDWITH}"
+ BLOCK_IO_READ_BANDWIDTH="BlockIOReadBandwidth=${BLOCK_IO_READ_BANDWIDTH}"
SET_PROPERTY="true"
fi
@@ -148,9 +148,9 @@ then
SET_PROPERTY="true"
fi
-if [ -n "${BLOCK_IO_WRITE_BANDWITH}" ]
+if [ -n "${BLOCK_IO_WRITE_BANDWIDTH}" ]
then
- BLOCK_IO_WRITE_BANDWITH="BlockIOReadBandwidth=${BLOCK_IO_WRITE_BANDWITH}"
+ BLOCK_IO_WRITE_BANDWIDTH="BlockIOReadBandwidth=${BLOCK_IO_WRITE_BANDWIDTH}"
SET_PROPERTY="true"
fi
@@ -193,7 +193,7 @@ do
done
# Run
-systemctl --runtime set-property ${NAME} ${BLOCK_IO_DEVICE_WEIGHT} ${BLOCK_IO_READ_BANDWITH} ${BLOCK_IO_WEIGHT} ${BLOCK_IO_WRITE_BANDWITH} ${CPU_QUOTA} ${CPU_SHARES} ${MEMORY_LIMIT} ${TASKS_MAX}
+systemctl --runtime set-property ${NAME} ${BLOCK_IO_DEVICE_WEIGHT} ${BLOCK_IO_READ_BANDWIDTH} ${BLOCK_IO_WEIGHT} ${BLOCK_IO_WRITE_BANDWIDTH} ${CPU_QUOTA} ${CPU_SHARES} ${MEMORY_LIMIT} ${TASKS_MAX}
# Post hooks
for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}"