From ec04243aa8a827bc4cd72799f378df6971409dfe Mon Sep 17 00:00:00 2001 From: Andrea Ceccanti Date: Wed, 3 Jun 2015 13:01:42 +0000 Subject: [PATCH 1/5] Reuse port and address --- src/frontend/storm-frontend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/storm-frontend.cpp b/src/frontend/storm-frontend.cpp index c882224..ac7b438 100644 --- a/src/frontend/storm-frontend.cpp +++ b/src/frontend/storm-frontend.cpp @@ -332,7 +332,7 @@ soap* initSoap() { soap_data->accept_timeout = 5; // supporting HTTP GET in order to reply the wsdl soap_data->fget = http_get; - // soap_data->bind_flags |= SO_REUSEADDR; + soap_data->bind_flags = SO_REUSEADDR; int flags = CGSI_OPT_DELEG_FLAG; // Renamed disable with enable and changed checks accordingly From a316e44a6580887ad9a53d0e663eadfd49e7c5b4 Mon Sep 17 00:00:00 2001 From: Andrea Ceccanti Date: Wed, 3 Jun 2015 13:02:01 +0000 Subject: [PATCH 2/5] Faster shutdown --- etc/init.d/storm-frontend-server.in | 6 ------ 1 file changed, 6 deletions(-) diff --git a/etc/init.d/storm-frontend-server.in b/etc/init.d/storm-frontend-server.in index 4c15266..4a4906b 100644 --- a/etc/init.d/storm-frontend-server.in +++ b/etc/init.d/storm-frontend-server.in @@ -153,12 +153,6 @@ case "$1" in echo -n "Stopping $prog.." kill -9 `cat $PIDFILE` >& /dev/null if [ $? -eq 0 ]; then - check_if_running - while [ $? -eq $TRUE ]; do - echo -n "." - sleep 1 - check_if_running - done rm -f $PIDFILE RETVAL=0 echo " ok" From c5298697b15d0971023b309e1b9bbe3f2511566e Mon Sep 17 00:00:00 2001 From: Andrea Ceccanti Date: Wed, 3 Jun 2015 13:30:10 +0000 Subject: [PATCH 3/5] avoid waiting for name resolution on netstat --- etc/init.d/storm-frontend-server.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/init.d/storm-frontend-server.in b/etc/init.d/storm-frontend-server.in index 4a4906b..e826996 100644 --- a/etc/init.d/storm-frontend-server.in +++ b/etc/init.d/storm-frontend-server.in @@ -65,7 +65,7 @@ check_if_running() { if [ $? -ne $SUCCESS ]; then return $FALSE # not running fi - IS_UP=`netstat -lp | grep $PID` + IS_UP=`netstat -lnp | grep $PID` if [ -z "$IS_UP" ]; then return $FALSE # not running fi From 04edb1e39d7b6c1331565c78abd897920ab0af2d Mon Sep 17 00:00:00 2001 From: Andrea Ceccanti Date: Wed, 3 Jun 2015 14:57:12 +0000 Subject: [PATCH 4/5] limit netstat call to tcp sockets --- etc/init.d/storm-frontend-server.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/init.d/storm-frontend-server.in b/etc/init.d/storm-frontend-server.in index e826996..1d9fc08 100644 --- a/etc/init.d/storm-frontend-server.in +++ b/etc/init.d/storm-frontend-server.in @@ -65,7 +65,7 @@ check_if_running() { if [ $? -ne $SUCCESS ]; then return $FALSE # not running fi - IS_UP=`netstat -lnp | grep $PID` + IS_UP=`netstat -tlnp | grep $PID` if [ -z "$IS_UP" ]; then return $FALSE # not running fi From 99f1d0faded37bfda2d0c66bbaf682bd9b8c4baa Mon Sep 17 00:00:00 2001 From: Andrea Ceccanti Date: Thu, 4 Jun 2015 08:37:24 +0000 Subject: [PATCH 5/5] check that socket is released but with shorter sleep time --- etc/init.d/storm-frontend-server.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/etc/init.d/storm-frontend-server.in b/etc/init.d/storm-frontend-server.in index 1d9fc08..0e3ac3d 100644 --- a/etc/init.d/storm-frontend-server.in +++ b/etc/init.d/storm-frontend-server.in @@ -153,6 +153,12 @@ case "$1" in echo -n "Stopping $prog.." kill -9 `cat $PIDFILE` >& /dev/null if [ $? -eq 0 ]; then + check_if_running + while [ $? -eq $TRUE ]; do + echo -n "." + sleep .1 + check_if_running + done rm -f $PIDFILE RETVAL=0 echo " ok"