Update earlyoom config file

This commit is contained in:
Konano 2023-11-27 13:14:42 +08:00
parent e4322a183c
commit 152ad5aa86
2 changed files with 23 additions and 1 deletions

View File

@ -1 +1,23 @@
# Default settings for earlyoom. This file is sourced by /bin/sh from
# /etc/init.d/earlyoom or by systemd from earlyoom.service.
# Options to pass to earlyoom
EARLYOOM_ARGS="-r 60"
# Examples:
# Print memory report every second instead of every minute
# EARLYOOM_ARGS="-r 1"
# Available minimum memory 5%
# EARLYOOM_ARGS="-m 5"
# Available minimum memory 15% and free minimum swap 5%
# EARLYOOM_ARGS="-m 15 -s 5"
# Avoid killing processes whose name matches this regexp
# EARLYOOM_ARGS="--avoid '(^|/)(init|X|sshd|firefox)$'"
# See more at `earlyoom -h'
EARLYOOM_ARGS="-m 6 -s 6"

View File

@ -189,7 +189,7 @@ configure_user_oom_killer() {
if confirm_action "要启用 earlyoom 吗?" "Y"; then
sudo apt install earlyoom -y
cat $scriptdir/files/earlyoom.conf | sudo tee -a /etc/default/earlyoom >/dev/null
sudo cp $scriptdir/files/earlyoom.conf /etc/default/earlyoom
sudo systemctl restart earlyoom
fi
}