diff options
author | Holger Hans Peter Freyther <holger@freyther.de> | 2012-06-13 16:47:51 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-07-09 10:07:46 +0200 |
commit | c1625ee2848ee500d0fa2655876fdb16ddaf5dd3 (patch) | |
tree | 5d6d82a5fb796817af4ef6708163bd0615375b55 /recipes-openmoko/openmoko-gsmd/files | |
parent | 4fed144378a38115805f986c56d883763f6dab79 (diff) |
openmoko-gsmd: Package the cell_log separately and respawn
Diffstat (limited to 'recipes-openmoko/openmoko-gsmd/files')
-rw-r--r-- | recipes-openmoko/openmoko-gsmd/files/cell-log | 37 | ||||
-rw-r--r-- | recipes-openmoko/openmoko-gsmd/files/gsmd | 2 | ||||
-rw-r--r-- | recipes-openmoko/openmoko-gsmd/files/gsmd-respawn.sh | 9 |
3 files changed, 47 insertions, 1 deletions
diff --git a/recipes-openmoko/openmoko-gsmd/files/cell-log b/recipes-openmoko/openmoko-gsmd/files/cell-log new file mode 100644 index 0000000..0da23a6 --- /dev/null +++ b/recipes-openmoko/openmoko-gsmd/files/cell-log @@ -0,0 +1,37 @@ +#! /bin/sh +# +# cell-log This shell script starts and stops cell-log. +# +# chkconfig: 345 90 40 +# description: Cell-log monitors cell in the neighborhood. +# processname: cell_log + +PATH=/bin:/usr/bin:/sbin:/usr/sbin + +case "$1" in + start) + echo -n "Starting cell-log: " + start-stop-daemon -S -b -x /etc/gsmd-respawn.sh /usr/bin/cell_log + + if [ $? = 0 ]; then + echo "cell-log" + else + echo "(failed.)" + fi + ;; + stop) + echo -n "Stopping GSM daemon: " + start-stop-daemon -K -x /usr/bin/cell_log + echo "cell-log." + ;; + restart|force-reload) + $0 stop + $0 start + ;; + *) + echo "Usage: /etc/init.d/cell-log {start|stop|restart|force-reload}" + exit 1 + ;; +esac + +exit 0 diff --git a/recipes-openmoko/openmoko-gsmd/files/gsmd b/recipes-openmoko/openmoko-gsmd/files/gsmd index dc10e63..c135e1f 100644 --- a/recipes-openmoko/openmoko-gsmd/files/gsmd +++ b/recipes-openmoko/openmoko-gsmd/files/gsmd @@ -19,7 +19,7 @@ case "$1" in [ -n "$GSM_RES" ] && ( echo "0" >$GSM_RES; sleep 2 ) echo -n "Starting GSM daemon: " - start-stop-daemon -S -x /usr/sbin/gsmd -- gsmd -p $GSM_DEV $GSMD_OPTS -d -l syslog + start-stop-daemon -S -b -x /etc/gsmd-respawn.sh /usr/sbin/gsmd -- gsmd -p $GSM_DEV $GSMD_OPTS -l syslog if [ $? = 0 ]; then echo "gsmd." diff --git a/recipes-openmoko/openmoko-gsmd/files/gsmd-respawn.sh b/recipes-openmoko/openmoko-gsmd/files/gsmd-respawn.sh new file mode 100644 index 0000000..d85dbb2 --- /dev/null +++ b/recipes-openmoko/openmoko-gsmd/files/gsmd-respawn.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +while true; +do + echo "Restarting not dealing well with spaces.." + (exec $*) || true + sleep 10s +done + |