Files
osmo-bts/contrib/respawn-only.sh
Holger Hans Peter Freyther 4ad8d4d3c0 sysmobts: Name the screen and use '-X quit' to shut it down
Use "kill -2 0" for the PCU as SIGTERM is not handled yet. With
the current set of code the stop function will stop both the PCU
and the BTS.
2013-03-16 23:29:59 +01:00

14 lines
224 B
Bash
Executable File

#!/bin/sh
PID=$$
echo "-1000" > /proc/$PID/oom_score_adj
trap "{ kill 0; kill -2 0; }" EXIT
while [ -f $1 ]; do
(echo "0" > /proc/self/oom_score_adj && exec nice -n -20 $*) &
LAST_PID=$!
wait $LAST_PID
sleep 10s
done