Commit af41b8dc authored by Stephan's avatar Stephan
Browse files

add bmxd timeout check

parent e15533bc
......@@ -8,7 +8,6 @@ DAEMON_PATH=/usr/bin
test -x $DAEMON_PATH/$DAEMON || exit 0
RUN_STATUS_FILE=/var/run/batman-status-running
DB_PATH=/var/lib/ddmesh/bmxd
STAT_DIR=/var/statistic
......@@ -128,17 +127,17 @@ case "$ARG1" in
$DAEMON_PATH/$DAEMON -c dev=-$ARG2
;;
check)
# connection check; if bmxd hangs, kill it
timeout -t 10 -s 9 $DAEMON -ci || killall -9 $DAEMON
test -z "$(pidof $DAEMON)" && logger -s "$DAEMON not running - restart" && $0 restart && exit
test -n "$(pidof $DAEMON)" && test ! -f "$RUN_STATUS_FILE" && (
touch $RUN_STATUS_FILE
$DAEMON_PATH/$DAEMON -c --gateways > $DB_PATH/gateways
$DAEMON_PATH/$DAEMON -c --links > $DB_PATH/links
$DAEMON_PATH/$DAEMON -c --originators > $DB_PATH/originators
$DAEMON_PATH/$DAEMON -c --status > $DB_PATH/status
# $DAEMON_PATH/$DAEMON -c --networks > $DB_PATH/networks
$DAEMON_PATH/$DAEMON -ci > $DB_PATH/info
rm $RUN_STATUS_FILE
)
;;
......
......@@ -50,7 +50,6 @@ call_task()
task_bmxd()
{
test $(pidof bmxd | wc -w) -gt 5 && kill -9 $(pidof bmxd) && logger -t $TAG "bmxd: ERROR bmxd dead - bmxd killed"
# check
WD_FILE=/tmp/state/bmxd.watchdog
MAX_BMXD_TIME=120
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment