Browse Source

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.
sysmocom/0.3.0-stable
Holger Hans Peter Freyther 10 years ago
parent
commit
4ad8d4d3c0
  1. 1
      contrib/respawn-only.sh
  2. 2
      contrib/respawn.sh
  3. 4
      contrib/sysmobts.init

1
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 $*) &

2
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

4
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)

Loading…
Cancel
Save