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.
This commit is contained in:
Holger Hans Peter Freyther 2013-03-16 23:18:23 +01:00
parent e45fc86359
commit 4ad8d4d3c0
3 changed files with 5 additions and 2 deletions

View File

@ -3,6 +3,7 @@
PID=$$ PID=$$
echo "-1000" > /proc/$PID/oom_score_adj echo "-1000" > /proc/$PID/oom_score_adj
trap "{ kill 0; kill -2 0; }" EXIT
while [ -f $1 ]; do while [ -f $1 ]; do
(echo "0" > /proc/self/oom_score_adj && exec nice -n -20 $*) & (echo "0" > /proc/self/oom_score_adj && exec nice -n -20 $*) &

View File

@ -3,6 +3,8 @@
PID=$$ PID=$$
echo "-1000" > /proc/$PID/oom_score_adj echo "-1000" > /proc/$PID/oom_score_adj
trap "kill 0" EXIT
while [ -e /etc/passwd ]; do while [ -e /etc/passwd ]; do
cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0
sleep 2s sleep 2s

View File

@ -11,10 +11,10 @@
case "$1" in case "$1" in
start) start)
/usr/bin/screen -d -m -c /etc/osmocom/screenrc-sysmobts /usr/bin/screen -d -m -c /etc/osmocom/screenrc-sysmobts -S sysmobts
;; ;;
stop) stop)
echo "This script doesn't support stop" /usr/bin/screen -d -r sysmobts -X quit
exit 1 exit 1
;; ;;
restart|reload|force-reload) restart|reload|force-reload)