Skip to content
Snippets Groups Projects
Commit c99da2ef authored by Holger Levsen's avatar Holger Levsen
Browse files

reproducible node health: only set /proc/$pid/oom_score_adj to -1000 if not already done

parent 29fd61f3
No related branches found
No related tags found
No related merge requests found
......@@ -204,7 +204,11 @@ PROCESSES="systemd squid"
for i in $PROCESSES ; do
PIDS=$(pgrep $i || true)
for pid in $PIDS ; do
[ ! -f /proc/$pid/oom_score_adj ] || echo -1000 | sudo tee /proc/$pid/oom_score_adj
PROC_OOM_SCORE=/proc/$pid/oom_score_adj
if [ -f $PROC_OOM_SCORE ] && [ $(cat $PROC_OOM_SCORE) -ne -1000 ] ; then
echo -n "Setting $PROC_OOM_SCORE to "
echo -1000 | sudo tee $PROC_OOM_SCORE
fi
done
done
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment