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

View File

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