aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-03-16 23:18:23 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-03-16 23:29:59 +0100
commit4ad8d4d3c0e46fa50fe421c6957db1ea4b048b62 (patch)
tree04cbfbd1e6f7a31c5aa60740b4ce956b39470ec9 /contrib
parente45fc8635926f70b0e19d5214f1f8b8fd06068aa (diff)
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.
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/respawn-only.sh1
-rwxr-xr-xcontrib/respawn.sh2
-rwxr-xr-xcontrib/sysmobts.init4
3 files changed, 5 insertions, 2 deletions
diff --git a/contrib/respawn-only.sh b/contrib/respawn-only.sh
index 66aaac79..478abd66 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 44e4fdc3..196edadc 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 8b7b39bd..2b9d2814 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)