Commit 756e3914 authored by Stephan's avatar Stephan
Browse files

bmxd: maximal allow 5 bmxd instances that could be run in parallel. Firmware...

bmxd: maximal allow 5 bmxd instances that could be run in parallel. Firmware can call bmxd because of gui, ddmesh-tasks.sh, backbone and interface updates
parent 17a35042
Pipeline #1673 passed with stages
in 92 minutes and 45 seconds
......@@ -13,6 +13,8 @@ DB_PATH=/var/lib/ddmesh/bmxd
STAT_DIR=/var/statistic
WD_FILE=/tmp/state/bmxd.watchdog
TAG="bmxd"
# maximal parallel instances (used internally and gui)
bmxd_max_instances=5
mkdir -p $DB_PATH
mkdir -p $STAT_DIR
......@@ -162,7 +164,7 @@ case "$ARG1" in
# too many instances running (count no zombies)
bmxd_count=$(ps | awk '{ if(match($4,"Z")==0 && (match($5,"^bmxd$") || match($5,"^/usr/bin/bmxd$")) ){print $5}}' | wc -l)
test "$bmxd_count" -gt 4 && logger -s -t "$TAG" "bmxd: too many instances ($bmxd_count)" && bmxd_restart=1
test "$bmxd_count" -gt $bmxd_max_instances && logger -s -t "$TAG" "bmxd: too many instances ($bmxd_count/$bmxd_max_instances)" && bmxd_restart=1
test $bmxd_restart = 1 && logger -s -t "$TAG" "$DAEMON not running - restart" && $0 restart
......
......@@ -13,6 +13,8 @@ DB_PATH=/var/lib/ddmesh/bmxd
STAT_DIR=/var/statistic
WD_FILE=/tmp/state/bmxd.watchdog
TAG="bmxd"
# maximal parallel instances (used internally and gui)
bmxd_max_instances=5
mkdir -p $DB_PATH
mkdir -p $STAT_DIR
......@@ -160,7 +162,7 @@ case "$ARG1" in
fi
# too many instances running (count no zombies)
bmxd_count=$(ps | awk '{ if(match($4,"Z")==0 && (match($5,"^bmxd$") || match($5,"^/usr/bin/bmxd$")) ){print $5}}' | wc -l)
test "$bmxd_count" -gt 4 && logger -s -t "$TAG" "bmxd: too many instances ($bmxd_count)" && bmxd_restart=1
test "$bmxd_count" -gt $bmxd_max_instances && logger -s -t "$TAG" "bmxd: too many instances ($bmxd_count/$bmxd_max_instances)" && bmxd_restart=1
test $bmxd_restart = 1 && logger -s -t "$TAG" "$DAEMON not running - restart" && $0 restart
......
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