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
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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
#