diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-03-15 23:21:22 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-03-15 23:21:22 +0100 |
commit | 3e7dbdcdba6431d57c24864c3fb96882a3383e52 (patch) | |
tree | ca5e6ec7737b7289fbf0fdd007533c280f43d00b /recipes-openmoko/openmoko-gsmd | |
parent | 90d152fcff21f2795a4ec4dc24ca19e585ffd327 (diff) |
gsmd: Adjust the oom score of the monitor process
Adjust the score for the monitor process. The issue is that the
score is inherited by the process. Right now the score of the
child is adjusted _after_ the process has been spawned. This is
obviously a race condition.
Diffstat (limited to 'recipes-openmoko/openmoko-gsmd')
-rw-r--r-- | recipes-openmoko/openmoko-gsmd/files/gsmd-respawn.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/recipes-openmoko/openmoko-gsmd/files/gsmd-respawn.sh b/recipes-openmoko/openmoko-gsmd/files/gsmd-respawn.sh index b1fe134..99435ed 100644 --- a/recipes-openmoko/openmoko-gsmd/files/gsmd-respawn.sh +++ b/recipes-openmoko/openmoko-gsmd/files/gsmd-respawn.sh @@ -4,13 +4,17 @@ NAME=`basename $1` PIDFILE="/var/run/$NAME.pid" PID=$$ echo "$PID" > $PIDFILE +echo "-1000" > /proc/$PID/oom_score_adj trap "{ rm -f $PIDFILE ; kill 0; }" EXIT while true; do echo "Restarting not dealing well with spaces.." - (exec $*) || true + exec $* & + LAST_PID=$! + echo "0" > /proc/$LAST_PID/oom_score_adj + wait $LAST_PID sleep 10s done |