haproxyctl 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/README.md +2 -0
- data/bin/haproxyctl +3 -3
- data/haproxyctl +3 -3
- data/lib/haproxyctl/environment.rb +4 -2
- data/lib/haproxyctl/version.rb +1 -1
- metadata +3 -3
data/LICENSE
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Copyright (C) 2010-2012
|
2
2
|
author: Carlo Flores <github@petalphile.com>
|
3
3
|
contributors: Scott Gonyea, John A. Barbuto, Ben Lovett,
|
4
|
-
Till Klampaeckel, Erik Osterman
|
4
|
+
Till Klampaeckel, Erik Osterman, Martin Hald, DeniedBoarding
|
5
5
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining
|
7
7
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
@@ -315,6 +315,8 @@ Ordered by date of first contribution.
|
|
315
315
|
- [John A. Barbuto aka `jbarbuto`](https://github.com/jbarbuto)
|
316
316
|
- [Till Klampaeckel aka `till`](https://github.com/till)
|
317
317
|
- [Erik Osterman aka `osterman`](https://github.com/osterman)
|
318
|
+
- [Martin Hald aka `mhald`](https://github.com/mhald)
|
319
|
+
- [deniedboarding](https://github.com/deniedboarding)
|
318
320
|
|
319
321
|
License
|
320
322
|
-----------------
|
data/bin/haproxyctl
CHANGED
@@ -117,7 +117,7 @@ begin
|
|
117
117
|
backend_group = line.split(',')
|
118
118
|
status.each do |pool|
|
119
119
|
data = pool.split(',')
|
120
|
-
if ( (data[0] == backend_group[0]) && ( data[1] !~ /#{servername}|BACKEND|FRONTEND/ ) && ( data[17]
|
120
|
+
if ( (data[0] == backend_group[0]) && ( data[1] !~ /#{servername}|BACKEND|FRONTEND/ ) && ( data[17] == 'UP' ) )
|
121
121
|
unixsock("disable server #{data[0]}/#{data[1]}")
|
122
122
|
end
|
123
123
|
end
|
@@ -127,7 +127,7 @@ begin
|
|
127
127
|
status=unixsock("show stat")
|
128
128
|
status.each do |line|
|
129
129
|
data = line.split(',')
|
130
|
-
if ( ( data[1]
|
130
|
+
if ( ( data[1] == servername ) && ( data[17] == 'UP' ) )
|
131
131
|
unixsock("disable server #{data[0]}/#{servername}")
|
132
132
|
end
|
133
133
|
end
|
@@ -149,7 +149,7 @@ begin
|
|
149
149
|
status=unixsock("show stat")
|
150
150
|
status.each do |line|
|
151
151
|
data = line.split(',')
|
152
|
-
if ( ( data[1]
|
152
|
+
if ( ( data[1] == servername ) && ( data[17] =~ /Down|MAINT/i ) )
|
153
153
|
unixsock("enable server #{data[0]}/#{servername}")
|
154
154
|
end
|
155
155
|
end
|
data/haproxyctl
CHANGED
@@ -117,7 +117,7 @@ begin
|
|
117
117
|
backend_group = line.split(',')
|
118
118
|
status.each do |pool|
|
119
119
|
data = pool.split(',')
|
120
|
-
if ( (data[0] == backend_group[0]) && ( data[1] !~ /#{servername}|BACKEND|FRONTEND/ ) && ( data[17]
|
120
|
+
if ( (data[0] == backend_group[0]) && ( data[1] !~ /#{servername}|BACKEND|FRONTEND/ ) && ( data[17] == 'UP' ) )
|
121
121
|
unixsock("disable server #{data[0]}/#{data[1]}")
|
122
122
|
end
|
123
123
|
end
|
@@ -127,7 +127,7 @@ begin
|
|
127
127
|
status=unixsock("show stat")
|
128
128
|
status.each do |line|
|
129
129
|
data = line.split(',')
|
130
|
-
if ( ( data[1]
|
130
|
+
if ( ( data[1] == servername ) && ( data[17] == 'UP' ) )
|
131
131
|
unixsock("disable server #{data[0]}/#{servername}")
|
132
132
|
end
|
133
133
|
end
|
@@ -149,7 +149,7 @@ begin
|
|
149
149
|
status=unixsock("show stat")
|
150
150
|
status.each do |line|
|
151
151
|
data = line.split(',')
|
152
|
-
if ( ( data[1]
|
152
|
+
if ( ( data[1] == servername ) && ( data[17] =~ /Down|MAINT/i ) )
|
153
153
|
unixsock("enable server #{data[0]}/#{servername}")
|
154
154
|
end
|
155
155
|
end
|
@@ -58,8 +58,10 @@ module HAProxyCTL
|
|
58
58
|
|
59
59
|
# @return [String, nil] Returns the PID of HAProxy as a string, if running. Nil otherwise.
|
60
60
|
def check_running
|
61
|
-
|
62
|
-
|
61
|
+
if File.exists?(pidfile)
|
62
|
+
pid = File.read(pidfile)
|
63
|
+
pid.strip!
|
64
|
+
end
|
63
65
|
|
64
66
|
# verify this pid exists and is haproxy
|
65
67
|
if pid =~ /^\d+$/ and `ps -p #{pid} -o cmd=` =~ /#{exec}/
|
data/lib/haproxyctl/version.rb
CHANGED
metadata
CHANGED
@@ -4,10 +4,10 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
- 2
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 1.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Carlo Flores
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2013-03-11 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|