pass memory limit as argument to starttask.sh
This commit is contained in:
@@ -23,6 +23,7 @@ fi
|
||||
readonly task_id="$1"
|
||||
readonly logfile="$2"
|
||||
readonly nice="$3"
|
||||
readonly memory_limit_mb="$4"
|
||||
|
||||
readonly service_name="box-task-${task_id}"
|
||||
systemctl reset-failed "${service_name}" || true
|
||||
@@ -31,9 +32,9 @@ readonly id=$(id -u $SUDO_USER)
|
||||
readonly ubuntu_version=$(lsb_release -rs)
|
||||
|
||||
if [[ "${ubuntu_version}" == "16.04" ]]; then
|
||||
options="-p MemoryLimit=400M --remain-after-exit"
|
||||
options="-p MemoryLimit=${memory_limit_mb}M --remain-after-exit"
|
||||
else
|
||||
options="-p MemoryMax=400M --pipe --wait"
|
||||
options="-p MemoryMax=${memory_limit_mb}M --pipe --wait"
|
||||
|
||||
# Note: BindsTo will kill this task when the box is stopped. but will not kill this task when restarted!
|
||||
# For this reason, we have code to kill the tasks both on shutdown and startup.
|
||||
|
||||
Reference in New Issue
Block a user