backups: give is a low oomScoreAdjust to not get killed
This commit is contained in:
@@ -24,6 +24,7 @@ readonly task_id="$1"
|
||||
readonly logfile="$2"
|
||||
readonly nice="$3"
|
||||
readonly memory_limit_mb="$4" # SI units
|
||||
readonly oom_score_adjust="$5"
|
||||
|
||||
readonly service_name="box-task-${task_id}"
|
||||
systemctl reset-failed "${service_name}" 2>/dev/null || true
|
||||
@@ -31,7 +32,7 @@ systemctl reset-failed "${service_name}" 2>/dev/null || true
|
||||
readonly id=$(id -u $SUDO_USER)
|
||||
readonly ubuntu_version=$(lsb_release -rs)
|
||||
|
||||
options="-p TimeoutStopSec=10s -p MemoryMax=${memory_limit_mb}M --pipe --wait"
|
||||
options="-p TimeoutStopSec=10s -p MemoryMax=${memory_limit_mb}M -p OOMScoreAdjust=${oom_score_adjust} --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