From 4ad8d4d3c0e46fa50fe421c6957db1ea4b048b62 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 16 Mar 2013 23:18:23 +0100 Subject: [PATCH] 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. --- contrib/respawn-only.sh | 1 + contrib/respawn.sh | 2 ++ contrib/sysmobts.init | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/respawn-only.sh b/contrib/respawn-only.sh index 66aaac79d..478abd666 100755 --- a/contrib/respawn-only.sh +++ b/contrib/respawn-only.sh @@ -3,6 +3,7 @@ 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 $*) & diff --git a/contrib/respawn.sh b/contrib/respawn.sh index 44e4fdc3c..196edadc0 100755 --- a/contrib/respawn.sh +++ b/contrib/respawn.sh @@ -3,6 +3,8 @@ PID=$$ echo "-1000" > /proc/$PID/oom_score_adj +trap "kill 0" EXIT + while [ -e /etc/passwd ]; do cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 sleep 2s diff --git a/contrib/sysmobts.init b/contrib/sysmobts.init index 8b7b39bd7..2b9d28143 100755 --- a/contrib/sysmobts.init +++ b/contrib/sysmobts.init @@ -11,10 +11,10 @@ case "$1" in start) - /usr/bin/screen -d -m -c /etc/osmocom/screenrc-sysmobts + /usr/bin/screen -d -m -c /etc/osmocom/screenrc-sysmobts -S sysmobts ;; stop) - echo "This script doesn't support stop" + /usr/bin/screen -d -r sysmobts -X quit exit 1 ;; restart|reload|force-reload)