diff options
Diffstat (limited to 'contrib/respawn-only.sh')
-rwxr-xr-x | contrib/respawn-only.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/respawn-only.sh b/contrib/respawn-only.sh index 4f611dd2..66aaac79 100755 --- a/contrib/respawn-only.sh +++ b/contrib/respawn-only.sh @@ -1,4 +1,12 @@ #!/bin/sh + +PID=$$ +echo "-1000" > /proc/$PID/oom_score_adj + + while [ -f $1 ]; do - nice -n -20 $* + (echo "0" > /proc/self/oom_score_adj && exec nice -n -20 $*) & + LAST_PID=$! + wait $LAST_PID + sleep 10s done |