cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [46/50] [abbrv] git commit: updated refs/heads/master to 4c5f792
Date Wed, 05 Nov 2014 10:45:40 GMT
CLOUDSTACK-7841: Gracefully reload haproxy config

The old way would disconnect all the existing connections through haproxy when
reload the config.

This new way would ensure that all the existing connections would still alive
after reload the config.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c15ed74f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c15ed74f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c15ed74f

Branch: refs/heads/master
Commit: c15ed74f63559dca7692cfcfe695e195c3401454
Parents: a43fba6
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Tue Nov 4 16:26:23 2014 -0800
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Tue Nov 4 16:41:46 2014 -0800

----------------------------------------------------------------------
 systemvm/patches/debian/config/root/reconfigLB.sh | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c15ed74f/systemvm/patches/debian/config/root/reconfigLB.sh
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/root/reconfigLB.sh b/systemvm/patches/debian/config/root/reconfigLB.sh
index 70a2912..e68cc3d 100755
--- a/systemvm/patches/debian/config/root/reconfigLB.sh
+++ b/systemvm/patches/debian/config/root/reconfigLB.sh
@@ -23,23 +23,16 @@ new_config=$1
 
 # save previous state
   mv /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.old
-  mv /var/run/haproxy.pid /var/run/haproxy.pid.old
 
   mv $new_config /etc/haproxy/haproxy.cfg
-  kill -TTOU $(cat /var/run/haproxy.pid.old)
-  sleep 2
-  if haproxy -D -p /var/run/haproxy.pid -f /etc/haproxy/haproxy.cfg; then
+  if haproxy -p /var/run/haproxy.pid -f /etc/haproxy/haproxy.cfg -sf $(cat /var/run/haproxy.pid);
then
     logger -t cloud "New haproxy instance successfully loaded, stopping previous one."
-    kill -KILL $(cat /var/run/haproxy.pid.old)
-    rm -f /var/run/haproxy.pid.old
     ret=0
   else
     logger -t cloud "New instance failed to start, resuming previous one."
-    kill -TTIN $(cat /var/run/haproxy.pid.old)
-    rm -f /var/run/haproxy.pid
-    mv /var/run/haproxy.pid.old /var/run/haproxy.pid
     mv /etc/haproxy/haproxy.cfg $new_config
     mv /etc/haproxy/haproxy.cfg.old /etc/haproxy/haproxy.cfg
+    haproxy -p /var/run/haproxy.pid -f /etc/haproxy/haproxy.cfg -sf $(cat /var/run/haproxy.pid)
     ret=1
   fi
 


Mime
View raw message