Ignore failure to write oom_score_adj

This commit is contained in:
Michael Vines 2018-08-07 12:37:33 -07:00
parent e3cf1e6598
commit 02f9cb415b
1 changed files with 6 additions and 6 deletions

View File

@ -180,12 +180,12 @@ oom_score_adj() {
return
fi
(
echo "$score" > "/proc/$pid/oom_score_adj"
if [[ $score != $(cat "/proc/$pid/oom_score_adj") ]]; then
echo "Failed to set oom_score_adj for pid $pid"
fi
)
echo "$score" > "/proc/$pid/oom_score_adj" || true
declare currentScore
currentScore=$(cat "/proc/$pid/oom_score_adj" || true)
if [[ $score != "$currentScore" ]]; then
echo "Failed to set oom_score_adj to $score for pid $pid (current score: $currentScore)"
fi
}
SOLANA_CONFIG_DIR=${SNAP_DATA:-$PWD}/config