openmoko-gsmd: Package the cell_log separately and respawn

This commit is contained in:
Holger Hans Peter Freyther 2012-06-13 16:47:51 +08:00 committed by Holger Hans Peter Freyther
parent 4fed144378
commit c1625ee284
4 changed files with 61 additions and 4 deletions

View File

@ -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

View File

@ -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."

View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
while true;
do
echo "Restarting not dealing well with spaces.."
(exec $*) || true
sleep 10s
done

View File

@ -9,11 +9,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
# Fork with wavecom support
SRC_URI = "git://git.gnumonks.org/openmoko-gsmd.git;branch=master \
file://gsmd \
file://cell-log \
file://gsmd-respawn.sh \
file://default"
SRCREV = "28e25ae42da7d65face9ad2472075f7c4fc87e92"
S = "${WORKDIR}/git"
PR = "r8"
PR = "r11.2"
inherit autotools pkgconfig update-rc.d
@ -21,17 +23,24 @@ inherit autotools pkgconfig update-rc.d
# handle update-rc.d RDEPENDS_${PN} manually, we don't need it on
# anything but gsmd
INITSCRIPT_NAME = "gsmd"
INITSCRIPT_PARAMS = "defaults 35"
INITSCRIPT_PACKAGES = "${PN} ${PN}-tools-cell-log"
INITSCRIPT_NAME_${PN} = "gsmd"
INITSCRIPT_PARAMS_${PN} = "defaults 35"
INITSCRIPT_NAME_${PN}-tools-cell-log = "cell-log"
INITSCRIPT_PARAMS_${PN}-tools-cell-log = "defaults 40"
do_install_append() {
install -d ${D}/${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/gsmd ${D}/${sysconfdir}/init.d/
install -m 0755 ${WORKDIR}/cell-log ${D}/${sysconfdir}/init.d/
install -d ${D}/${sysconfdir}/default
install ${WORKDIR}/default ${D}/${sysconfdir}/default/gsmd
install -m 0755 ${WORKDIR}/gsmd-respawn.sh ${D}/${sysconfdir}/
}
PACKAGES =+ "\
${PN}-tools-cell-log \
${PN}-tools \
${PN}-plugins \
${PN}-plugin-machine-generic \
@ -60,8 +69,10 @@ RDEPENDS_${PN}-plugins = "\
"
RDEPENDS_${PN} += "update-rc.d"
RDEPENDS_${PN}-tools-cell-log += "update-rc.d ${PN}"
FILES_${PN}-dbg += "${libdir}/gsmd/.debug/*"
FILES_${PN}-tools-cell-log = "${bindir}/cell_log ${sysconfdir}/cell-log"
FILES_${PN}-tools = "${bindir}/*"
FILES_${PN}-plugins = ""
FILES_${PN}-dev += " ${libdir}/gsmd/*.la "