enigma2: set the linux OOM score for the enigma2 process.. so the kernel first kills...
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-vuplus / enigma2 / enigma2 / enigma2_vuplus_proc_oom_score_adj.patch
1 diff --git a/tools/enigma2.sh.in b/tools/enigma2.sh.in
2 index 2f9292a..170835e 100755
3 --- a/tools/enigma2.sh.in
4 +++ b/tools/enigma2.sh.in
5 @@ -24,6 +24,9 @@ if [ -e @libdir@/libpassthrough.so ]; then
6         LIBS="$LIBS @libdir@/libpassthrough.so"
7  fi
8  
9 +(sleep 2; echo "enigma2 is the main pvr application... adjust oom score!"; PID=$(pidof enigma2); \
10 +        [ -e /proc/$PID/oom_score_adj ] && echo "-999" > /proc/$PID/oom_score_adj || echo "-17" > /proc/$PID/oom_adj;) &
11 +
12  LD_PRELOAD=$LIBS @bindir@/enigma2
13  
14  # enigma2 exit codes: