respawn: Adjust the oom score for the supervisor and bts/pcu, increase sleep
Make the script mostly unkillable due to OOM and make sure that the process has a score of zero. Wait 10 seconds before re-launching. The combination of ( && exec ) & appears to save one sub-process. The script has been tested with bash and busybox's ash.
This commit is contained in:
parent
54dd949e62
commit
e45fc86359
|
@ -1,4 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
PID=$$
|
||||||
|
echo "-1000" > /proc/$PID/oom_score_adj
|
||||||
|
|
||||||
|
|
||||||
while [ -f $1 ]; do
|
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
|
done
|
||||||
|
|
|
@ -1,6 +1,16 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
PID=$$
|
||||||
|
echo "-1000" > /proc/$PID/oom_score_adj
|
||||||
|
|
||||||
while [ -e /etc/passwd ]; do
|
while [ -e /etc/passwd ]; do
|
||||||
|
cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0
|
||||||
|
sleep 2s
|
||||||
cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0
|
cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0
|
||||||
|
sleep 1s
|
||||||
echo "0" > /sys/class/leds/activity_led/brightness
|
echo "0" > /sys/class/leds/activity_led/brightness
|
||||||
nice -n -20 $*
|
(echo "0" > /proc/self/oom_score_adj && exec nice -n -20 $*) &
|
||||||
|
LAST_PID=$!
|
||||||
|
wait $LAST_PID
|
||||||
|
sleep 10s
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue