Skip to content
Permalink
Browse files

[bugfix] nftlb is killed when zevenet is stopped

Signed-off-by: Alvaro Cano <alvaro.cano@zevenet.com>

	modified:   DEBIAN/control
	modified:   usr/local/zevenet/bin/nftlbd
	modified:   usr/local/zevenet/bin/zevenet
  • Loading branch information...
alvarocano-zevenet committed Sep 11, 2019
1 parent 9cdb85f commit ab93a9a82aed41a8f59239376f349c1f9f3ef266
Showing with 18 additions and 8 deletions.
  1. +1 −1 DEBIAN/control
  2. +15 −6 usr/local/zevenet/bin/nftlbd
  3. +2 −1 usr/local/zevenet/bin/zevenet
@@ -1,5 +1,5 @@
Package: zevenet
Version: 5.9.2
Version: 5.9.3
Maintainer: Zevenet SL <zevenet-ce-users@zevenet.com>
Architecture: amd64
Section: admin
@@ -1,19 +1,26 @@
#!/bin/sh

DEBUG=""
NFTBIN=/usr/local/sbin/nft
#NFTBIN=`which nft`
GLOBALCONF="/usr/local/zevenet/config/global.conf"
if [ -f "$GLOBALCONF" ]; then
LEVEL=`grep ^.debug= "$GLOBALCONF" | awk -F'"' '{ printf $2 }' 2> /dev/null`
if [ ! -z $LEVEL ] && [ "$LEVEL" != "0" ]; then
DEBUG="-l $LEVEL"
# debug
VAR=`grep ^.debug= "$GLOBALCONF" | awk -F'"' '{ printf $2 }' 2> /dev/null`
if [ ! -z $VAR ] && [ "$VAR" != "0" ]; then
DEBUG="-l $VAR"
fi
# nft binary
VAR=`grep ^.nft_bin= "$GLOBALCONF" | awk -F'"' '{ printf $2 }' 2> /dev/null`
if [ ! -z $VAR ] && [ -e "$VAR" ]; then
NFTBIN="$VAR"
fi
fi

DESC="nftlb daemon service"
NAME=nftlb
DAEMON=/usr/local/zevenet/app/nftlb/sbin/nftlb
DAEMON_ARGS="$DEBUG -H 127.0.0.1 -k HoLa -P 27"
NFTBIN=`which nft`
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

@@ -29,10 +36,12 @@ do_start()
}

do_stop() {
`$NFTBIN flush ruleset`
start-stop-daemon --stop --signal 1 --quiet --remove-pidfile --pidfile $PIDFILE --name $NAME
PID=`pidof nftlb`
[ -n "$PID" ] && kill -9 $PID
`$NFTBIN delete table ip nftlb 2> /dev/null`
`$NFTBIN delete table netdev nftlb 2> /dev/null`
[ -f $PIDFILE ] && rm -i $PIDFILE
[ "$?" -ne 0 ] && return 2
}

case "$1" in
@@ -512,7 +512,8 @@ if ( $action eq "stop" )

my $stop_nftlb = `/usr/local/zevenet/bin/nftlbd stop`;
my $status = `/usr/local/zevenet/bin/nftlbd status`;
my $rtn_code = 0 if ( grep /nftlb is not running/, $status );
my $rtn_code = 1;
$rtn_code = 0 if ( grep /nftlb is not running/, $status );

if ( $rtn_code == 0 )
{

0 comments on commit ab93a9a

Please sign in to comment.
You can’t perform that action at this time.