Re: haproxy gone from epel

2013-02-25 Thread Michael Glenney
Ignore my last.  Looks like it was merged into rhel repo.

Rule #1 of Automation:  Manage your dependencies ;)

Shame on me


On Mon, Feb 25, 2013 at 9:57 PM, Michael Glenney wrote:

> Don't know how much control you guys have over this but it looks like
> haproxy has been removed from the EPEL repositories.  Anyone have any
> information about this?  Curious as to why.
>
> Last week haproxy-1.4.22-1.el6 was available.  can't find anything now.
>
> MG
>


haproxy gone from epel

2013-02-25 Thread Michael Glenney
Don't know how much control you guys have over this but it looks like
haproxy has been removed from the EPEL repositories.  Anyone have any
information about this?  Curious as to why.

Last week haproxy-1.4.22-1.el6 was available.  can't find anything now.

MG


[PATCH 13/13] MEDIUM: checks: Add supplementary agent checks

2013-02-25 Thread Simon Horman
Allow an agent check to be run in conjunction with one other server
health check.

If the backend for a server check is not lb-agent-chk then an agent
check may also be run using the agent-check parameter to a server,
which sets the TCP port to be used for the agent check.

e.g.
server  web1_1 127.0.0.1:80 check agent-port 1

The agent-inter parameter may also be used to specify the interval
and timeout for agent checks.

If either the health or agent check determines that a server is down
then it is marked as being down, otherwise it is marked as being up.

Signed-off-by: Simon Horman 
---
 doc/configuration.txt  |   61 ++---
 include/types/server.h |1 +
 src/cfgparse.c |   70 +---
 src/checks.c   |   13 +++--
 src/haproxy.c  |6 +
 5 files changed, 136 insertions(+), 15 deletions(-)

diff --git a/doc/configuration.txt b/doc/configuration.txt
index 28c5223..51020c1 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -764,11 +764,12 @@ nosplice
   "option splice-response".
 
 spread-checks <0..50, in percent>
-  Sometimes it is desirable to avoid sending health checks to servers at exact
-  intervals, for instance when many logical servers are located on the same
-  physical server. With the help of this parameter, it becomes possible to add
-  some randomness in the check interval between 0 and +/- 50%. A value between
-  2 and 5 seems to show good results. The default value remains at 0.
+  Sometimes it is desirable to avoid sending agent and health checks to
+  servers at exact intervals, for instance when many logical servers are
+  located on the same physical server. With the help of this parameter, it
+  becomes possible to add some randomness in the check interval between 0
+  and +/- 50%. A value between 2 and 5 seems to show good results. The
+  default value remains at 0.
 
 tune.bufsize 
   Sets the buffer size to this size (in bytes). Lower values allow more
@@ -3771,6 +3772,9 @@ option lb-agent-chk
   information described above. Otherwise the port of the serivce will be
   used.
 
+  This option conflicts with the agent-port parameter to a server.
+
+
 option ldap-check
   Use LDAPv3 health checks for server testing
   May be used in sections :   defaults | frontend | listen | backend
@@ -7373,6 +7377,43 @@ addr 
 
   Supported in default-server: No
 
+agent-inter 
+  The "agent-inter" parameter sets the interval between two agent checks
+  to  milliseconds. If left unspecified, the delay defaults to 2000 ms.
+
+  Just as with every other time-based parameter, it may be entered in any
+  other explicit unit among { us, ms, s, m, h, d }. The "agent-inter"
+  parameter also serves as a timeout for agent checks "timeout check" is
+  not set. In order to reduce "resonance" effects when multiple servers are
+  hosted on the same hardware, the agent and health checks of all servers
+  are started with a small time offset between them. It is also possible to
+  add some random noise in the agent and health checks interval using the
+  global "spread-checks" keyword. This makes sense for instance when a lot
+  of backends use the same servers.
+
+  Requires the "agent-port" parameter to be set.
+
+  Supported in default-server: Yes
+
+agent-port 
+  Using the "agent-port" parameter, it becomes possible to run an agent
+  check in conjunction with a regular health check. In this scenario the
+  "agent-port" parameter specifies the TCP that an agent check should
+  connect to. Typically this is different to the port of the service and
+  health-check.
+
+  For a description agent checks and the protocol used by them see the
+  description of "lb-agent-check".
+
+  In this the agent check is run in conjunction with another check
+  and as such the check backend should be set to some value other than
+  "lb-agent-check". An alternative scenario is to run only an agent check
+  in which case the check backend should be set to "lb-agent-check" and
+  "agent-port" should not be set; in that scenario the port may be set
+  using the "port" parameter.
+
+  See also the "agent-inter" parameter.
+
 backup
   When "backup" is present on a server line, the server is only used in load
   balancing when all other non-backup servers are unavailable. Requests coming
@@ -7549,11 +7590,11 @@ downinter 
   other explicit unit among { us, ms, s, m, h, d }. The "inter" parameter also
   serves as a timeout for health checks sent to servers if "timeout check" is
   not set. In order to reduce "resonance" effects when multiple servers are
-  hosted on the same hardware, the health-checks of all servers are started
-  with a small time offset between them. It is also possible to add some random
-  noise in the health checks interval using the global "spread-checks"
-  keyword. This makes sense for instance when a lot of backends use the same
-  servers.
+  hosted on the same hardware, the 

[PATCH 12/13] MEDIUM: Add helper for task creation for checks

2013-02-25 Thread Simon Horman
This helper is in preparation for adding a second struct check element
to struct server.

Signed-off-by: Simon Horman 
---
 src/checks.c |   47 ---
 1 file changed, 28 insertions(+), 19 deletions(-)

diff --git a/src/checks.c b/src/checks.c
index 2a4f8fd..3ab8750 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -1517,6 +1517,32 @@ static struct task *process_chk(struct task *t)
return t;
 }
 
+static int start_check_task(struct check *check, int mininter,
+   int nbcheck, int srvpos)
+{
+   struct task *t;
+   /* task for the check */
+   if ((t = task_new()) == NULL) {
+   Alert("Starting [%s:%s] check: out of memory.\n",
+ check->server->proxy->id, check->server->id);
+   return -1;
+   }
+
+   check->task = t;
+   t->process = process_chk;
+   t->context = check;
+
+   /* check this every ms */
+   t->expire = tick_add(now_ms,
+MS_TO_TICKS(((mininter &&
+  mininter >= srv_getinter(check)) ?
+ mininter : srv_getinter(check)) * 
srvpos / nbcheck));
+   check->start = now;
+   task_queue(t);
+
+   return 0;
+}
+
 /*
  * Start health-check.
  * Returns 0 if OK, -1 if error, and prints the error in this case.
@@ -1577,26 +1603,9 @@ int start_checks() {
if (!(s->state & SRV_CHECKED))
continue;
 
-   /* one task for the checks */
-   if ((t = task_new()) == NULL) {
-   Alert("Starting [%s:%s] check: out of 
memory.\n", px->id, s->id);
-   return -1;
-   }
-
-   s->check.task = t;
s->check.type = s->proxy->options2 & PR_O2_CHK_ANY;
-   t->process = process_chk;
-   t->context = &s->check;
-
-   /* check this every ms */
-   t->expire = tick_add(now_ms,
-MS_TO_TICKS(((mininter &&
-  mininter >= 
srv_getinter(&s->check)) ?
- mininter : 
srv_getinter(&s->check)) * srvpos / nbcheck));
-   s->check.start = now;
-   task_queue(t);
-
-   srvpos++;
+   if (start_check_task(&s->check, mininter, nbcheck, 
srvpos++))
+   return -1;
}
}
return 0;
-- 
1.7.10.4




[PATCH 08/13] MEDIUM: Add state to struct check

2013-02-25 Thread Simon Horman
Add state to struct check. This is currently used to store one bit,
CHK_RUNNING, which is set if a check is running and clear otherwise.
This bit was previously SRV_CHK_RUNNING of the state element of struct
server.

This is in preparation for associating a agent check
with a server which runs as well as the server's existing check.

Signed-off-by: Simon Horman 
---
 include/types/server.h |5 -
 src/checks.c   |8 
 src/dumpstats.c|2 +-
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/include/types/server.h b/include/types/server.h
index ac5903d..f6d98a2 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -55,7 +55,6 @@
 /* unused: 0x0100, 0x0200, 0x0400 */
 #define SRV_SEND_PROXY 0x0800  /* this server talks the PROXY protocol */
 #define SRV_NON_STICK  0x1000  /* never add connections allocated to this 
server to a stick table */
-#define SRV_CHK_RUNNING 0x2000  /* a check is currently running on this server 
*/
 
 /* function which act on servers need to return various errors */
 #define SRV_STATUS_OK   0   /* everything is OK. */
@@ -70,6 +69,9 @@
 #define SRV_CHK_PASSED  0x0002   /* server check succeeded unless FAILED is 
also set */
 #define SRV_CHK_DISABLE 0x0004   /* server returned a "disable" code */
 
+/* check flags */
+#define CHK_RUNNING0x0001  /* this check is currently running */
+
 /* various constants */
 #define SRV_UWGHT_RANGE 256
 #define SRV_UWGHT_MAX   (SRV_UWGHT_RANGE - 1)
@@ -117,6 +119,7 @@ struct check {
int send_proxy; /* send a PROXY protocol header 
with checks */
int inter, fastinter, downinter;/* checks: time in milliseconds 
*/
int result; /* health-check result : 
SRV_CHK_* */
+   int state;  /* health-check result : CHK_* 
*/
struct server *server;  /* back-pointer to server */
 };
 
diff --git a/src/checks.c b/src/checks.c
index 53ca045..700397a 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -1312,7 +1312,7 @@ static struct task *process_chk(struct task *t)
int ret;
int expired = tick_is_expired(t->expire, now_ms);
 
-   if (!(s->state & SRV_CHK_RUNNING)) {
+   if (!(check->state & CHK_RUNNING)) {
/* no check currently running */
if (!expired) /* woke up too early */
return t;
@@ -1326,7 +1326,7 @@ static struct task *process_chk(struct task *t)
/* we'll initiate a new check */
set_server_check_status(check, HCHK_STATUS_START, NULL);
 
-   s->state |= SRV_CHK_RUNNING;
+   check->state |= CHK_RUNNING;
check->bi->p = check->bi->data;
check->bi->i = 0;
check->bo->p = check->bo->data;
@@ -1415,7 +1415,7 @@ static struct task *process_chk(struct task *t)
 
/* here, we have seen a synchronous error, no fd was allocated 
*/
 
-   s->state &= ~SRV_CHK_RUNNING;
+   check->state &= ~CHK_RUNNING;
if (s->health > s->rise) {
s->health--; /* still good */
s->counters.failed_checks++;
@@ -1500,7 +1500,7 @@ static struct task *process_chk(struct task *t)
set_server_up(check);
}
}
-   s->state &= ~SRV_CHK_RUNNING;
+   check->state &= ~CHK_RUNNING;
 
rv = 0;
if (global.spread_checks > 0) {
diff --git a/src/dumpstats.c b/src/dumpstats.c
index 0d911c7..10f19e9 100644
--- a/src/dumpstats.c
+++ b/src/dumpstats.c
@@ -2256,7 +2256,7 @@ static int stats_dump_sv_stats(struct stream_interface 
*si, struct proxy *px, in
if (sv->state & SRV_CHECKED) {
chunk_appendf(&trash,
  " %s%s",
- (sv->state & SRV_CHK_RUNNING) ? "* " : "",
+ (sv->check.state & CHK_RUNNING) ? "* " : 
"",
  get_check_status_info(sv->check.status));
 
if (sv->check.status >= HCHK_STATUS_L57DATA)
-- 
1.7.10.4




[PATCH 10/13] MEDIUM: Move health element to struct check

2013-02-25 Thread Simon Horman
This is in preparation for associating a agent check
with a server which runs as well as the server's existing check.

Signed-off-by: Simon Horman 
---
 include/types/server.h |3 ++-
 src/cfgparse.c |   10 +-
 src/checks.c   |   50 
 src/dumpstats.c|   12 ++--
 src/proto_http.c   |2 +-
 src/server.c   |4 ++--
 6 files changed, 41 insertions(+), 40 deletions(-)

diff --git a/include/types/server.h b/include/types/server.h
index 97e09ca..e9e5d03 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -120,6 +120,8 @@ struct check {
int inter, fastinter, downinter;/* checks: time in milliseconds 
*/
int result; /* health-check result : 
SRV_CHK_* */
int state;  /* health-check result : CHK_* 
*/
+   int health; /* 0 to server->rise-1 = bad;
+* rise to 
server->rise+server->fall-1 = good */
const char *name;   /* Name of check: "Health" or 
"Agent" */
struct server *server;  /* back-pointer to server */
 };
@@ -151,7 +153,6 @@ struct server {
 
struct server *tracknext, *track;   /* next server in a tracking 
list, tracked server */
char *trackit;  /* temporary variable to make 
assignment deferrable */
-   int health; /* 0->rise-1 = bad; 
rise->rise+fall-1 = good */
int consecutive_errors; /* current number of 
consecutive errors */
int rise, fall; /* time in iterations */
int consecutive_errors_limit;   /* number of consecutive errors 
that triggers an event */
diff --git a/src/cfgparse.c b/src/cfgparse.c
index d5c59d9..25665a8 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -4171,7 +4171,7 @@ stats_error_parsing:
newsrv->uweight = newsrv->iweight
= curproxy->defsrv.iweight;
 
-   newsrv->health = newsrv->rise;  /* up, but will fall 
down at first failure */
+   newsrv->check.health = newsrv->rise;/* up, but will 
fall down at first failure */
 
cur_arg = 3;
} else {
@@ -4206,8 +4206,8 @@ stats_error_parsing:
goto out;
}
 
-   if (newsrv->health)
-   newsrv->health = newsrv->rise;
+   if (newsrv->check.health)
+   newsrv->check.health = newsrv->rise;
cur_arg += 2;
}
else if (!strcmp(args[cur_arg], "fall")) {
@@ -4378,7 +4378,7 @@ stats_error_parsing:
else if (!defsrv && !strcmp(args[cur_arg], "disabled")) 
{
newsrv->state |= SRV_MAINTAIN;
newsrv->state &= ~SRV_RUNNING;
-   newsrv->health = 0;
+   newsrv->check.health = 0;
cur_arg += 1;
}
else if (!defsrv && !strcmp(args[cur_arg], "observe")) {
@@ -6595,7 +6595,7 @@ out_uri_auth_compat:
if (srv->state & SRV_MAINTAIN) {
newsrv->state |= SRV_MAINTAIN;
newsrv->state &= ~SRV_RUNNING;
-   newsrv->health = 0;
+   newsrv->check.health = 0;
}
 
newsrv->track = srv;
diff --git a/src/checks.c b/src/checks.c
index 0379ac2..d75c0a2 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -230,8 +230,8 @@ static void set_server_check_status(struct check *check, 
short status, const cha
}
 
if (s->proxy->options2 & PR_O2_LOGHCHKS &&
-   (((s->health != 0) && (check->result & SRV_CHK_FAILED)) ||
-   ((s->health != s->rise + s->fall - 1) && (check->result & 
SRV_CHK_PASSED)) ||
+   (((check->health != 0) && (check->result & SRV_CHK_FAILED)) ||
+   ((check->health != s->rise + s->fall - 1) && (check->result & 
SRV_CHK_PASSED)) ||
((s->state & SRV_GOINGDOWN) && !(check->result & SRV_CHK_DISABLE)) 
||
(!(s->state & SRV_GOINGDOWN) && (check->result & 
SRV_CHK_DISABLE {
 
@@ -240,7 +240,7 @@ static void set_server_check_status(struct check *check, 
short status, const cha
chunk_reset(&trash);
 
/* FIXME begin: calculate local version of the 
health/rise/fall/state */
-   health = s->health;
+  

[PATCH 06/13] MEDIUM: Paramatise functions over the check of a server

2013-02-25 Thread Simon Horman
Paramatise the following functions over the check of a server

* set_server_down
* set_server_up
* srv_getinter
* server_status_printf
* set_server_check_status
* set_server_disabled

Generally the server parameter of these functions has been removed.
Where it is still needed it is obtained using check->server.

This is in preparation for associating a agent check
with a server which runs as well as the server's existing check.
By paramatising these functions they may act on each of the checks
without further significant modification.

Signed-off-by: Simon Horman 

---

This is a rather large patch and I would be happy to split it up
on request.
---
 include/proto/checks.h |4 +-
 include/proto/server.h |2 +-
 src/checks.c   |  477 
 src/dumpstats.c|8 +-
 src/proto_http.c   |4 +-
 src/server.c   |   10 +-
 6 files changed, 250 insertions(+), 255 deletions(-)

diff --git a/include/proto/checks.h b/include/proto/checks.h
index 042b854..f4f9c49 100644
--- a/include/proto/checks.h
+++ b/include/proto/checks.h
@@ -27,8 +27,8 @@
 
 const char *get_check_status_description(short check_status);
 const char *get_check_status_info(short check_status);
-void set_server_down(struct server *s);
-void set_server_up(struct server *s);
+void set_server_down(struct check *check);
+void set_server_up(struct check *check);
 int start_checks();
 void health_adjust(struct server *s, short status);
 
diff --git a/include/proto/server.h b/include/proto/server.h
index b2df045..1151b3c 100644
--- a/include/proto/server.h
+++ b/include/proto/server.h
@@ -33,7 +33,7 @@
 #include 
 
 int srv_downtime(const struct server *s);
-int srv_getinter(const struct server *s);
+int srv_getinter(const struct check *check);
 
 /* increase the number of cumulated connections on the designated server */
 static void inline srv_inc_sess_ctr(struct server *s)
diff --git a/src/checks.c b/src/checks.c
index aa48ab4..53ca045 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -148,33 +148,30 @@ const char *get_analyze_status(short analyze_status) {
return analyze_statuses[HANA_STATUS_UNKNOWN].desc;
 }
 
-#define SSP_O_HCHK 0x0002
-
-static void server_status_printf(struct chunk *msg, struct server *s, unsigned 
options, int xferred) {
-
+static void server_status_printf(struct chunk *msg, struct server *s, struct 
check *check, int xferred) {
if (s->track)
chunk_appendf(msg, " via %s/%s",
s->track->proxy->id, s->track->id);
 
-   if (options & SSP_O_HCHK) {
-   chunk_appendf(msg, ", reason: %s", 
get_check_status_description(s->check.status));
+   if (check) {
+   chunk_appendf(msg, ", reason: %s", 
get_check_status_description(check->status));
 
-   if (s->check.status >= HCHK_STATUS_L57DATA)
-   chunk_appendf(msg, ", code: %d", s->check.code);
+   if (check->status >= HCHK_STATUS_L57DATA)
+   chunk_appendf(msg, ", code: %d", check->code);
 
-   if (*s->check.desc) {
+   if (*check->desc) {
struct chunk src;
 
chunk_appendf(msg, ", info: \"");
 
-   chunk_initlen(&src, s->check.desc, 0, 
strlen(s->check.desc));
+   chunk_initlen(&src, check->desc, 0, 
strlen(check->desc));
chunk_asciiencode(msg, &src, '"');
 
chunk_appendf(msg, "\"");
}
 
-   if (s->check.duration >= 0)
-   chunk_appendf(msg, ", check duration: %ldms", 
s->check.duration);
+   if (check->duration >= 0)
+   chunk_appendf(msg, ", check duration: %ldms", 
check->duration);
}
 
if (xferred >= 0) {
@@ -194,47 +191,49 @@ static void server_status_printf(struct chunk *msg, 
struct server *s, unsigned o
 }
 
 /*
- * Set s->check.status, update s->check.duration and fill s->check.result with
+ * Set check->status, update check->duration and fill check->result with
  * an adequate SRV_CHK_* value.
  *
  * Show information in logs about failed health check if server is UP
  * or succeeded health checks if server is DOWN.
  */
-static void set_server_check_status(struct server *s, short status, const char 
*desc)
+static void set_server_check_status(struct check *check, short status, const 
char *desc)
 {
+   struct server *s = check->server;
+
if (status == HCHK_STATUS_START) {
-   s->check.result = SRV_CHK_UNKNOWN;  /* no result yet */
-   s->check.desc[0] = '\0';
-   s->check.start = now;
+   check->result = SRV_CHK_UNKNOWN;/* no result yet */
+   check->desc[0] = '\0';
+   check->start = now;
return;
}
 
-   if (!s->check.status)
+   if (!check->status)

[PATCH 11/13] MEDIUM: Add type type to struct check

2013-02-25 Thread Simon Horman
This is used to indicate the type of a check independent of
its server's proxy's check type.

This is in preparation for associating a agent check
with a server which runs as well as the server's existing check.

Signed-off-by: Simon Horman 
---
 include/types/server.h |1 +
 src/checks.c   |3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/types/server.h b/include/types/server.h
index e9e5d03..3a0281b 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -122,6 +122,7 @@ struct check {
int state;  /* health-check result : CHK_* 
*/
int health; /* 0 to server->rise-1 = bad;
 * rise to 
server->rise+server->fall-1 = good */
+   int type;   /* Check type, one of 
PR_O2_*_CHK */
const char *name;   /* Name of check: "Health" or 
"Agent" */
struct server *server;  /* back-pointer to server */
 };
diff --git a/src/checks.c b/src/checks.c
index d75c0a2..2a4f8fd 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -891,7 +891,7 @@ static void event_srv_chk_r(struct connection *conn)
}
 
/* Run the checks... */
-   switch (s->proxy->options2 & PR_O2_CHK_ANY) {
+   switch (check->type) {
case PR_O2_HTTP_CHK:
if (!done && check->bi->i < strlen("HTTP/1.0 000\r"))
goto wait_more_data;
@@ -1584,6 +1584,7 @@ int start_checks() {
}
 
s->check.task = t;
+   s->check.type = s->proxy->options2 & PR_O2_CHK_ANY;
t->process = process_chk;
t->context = &s->check;
 
-- 
1.7.10.4




[PATCH 07/13] MEDIUM: cfgparse: Factor out check initialisation

2013-02-25 Thread Simon Horman
This is in preparation for struct server having two elements
of type struct check.

Signed-off-by: Simon Horman 
---
 src/cfgparse.c |   56 +---
 1 file changed, 33 insertions(+), 23 deletions(-)

diff --git a/src/cfgparse.c b/src/cfgparse.c
index 62a0b54..c23a48d 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -1619,6 +1619,34 @@ out:
return err_code;
 }
 
+static int init_check(struct server *s, struct check *check, const char * 
file, int linenum)
+{
+   /* Allocate buffer for requests... */
+   if ((check->bi = calloc(sizeof(struct buffer) + global.tune.chksize, 
sizeof(char))) == NULL) {
+   Alert("parsing [%s:%d] : out of memory while allocating check 
buffer.\n", file, linenum);
+   return ERR_ALERT | ERR_ABORT;
+   }
+   check->bi->size = global.tune.chksize;
+
+   /* Allocate buffer for responses... */
+   if ((check->bo = calloc(sizeof(struct buffer) + global.tune.chksize, 
sizeof(char))) == NULL) {
+   Alert("parsing [%s:%d] : out of memory while allocating check 
buffer.\n", file, linenum);
+   return ERR_ALERT | ERR_ABORT;
+   }
+   check->bo->size = global.tune.chksize;
+
+   /* Allocate buffer for partial results... */
+   if ((check->conn = calloc(1, sizeof(struct connection))) == NULL) {
+   Alert("parsing [%s:%d] : out of memory while allocating check 
connection.\n", file, linenum);
+   return ERR_ALERT | ERR_ABORT;
+   }
+
+   check->conn->t.sock.fd = -1; /* no agent in progress yet */
+   check->status = HCHK_STATUS_INI;
+   check->server = s;
+
+   return 0;
+}
 
 int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
 {
@@ -4672,6 +4700,8 @@ stats_error_parsing:
}
 
if (do_check) {
+   int ret;
+
if (newsrv->trackit) {
Alert("parsing [%s:%d]: unable to enable checks 
and tracking at the same time!\n",
file, linenum);
@@ -4717,32 +4747,12 @@ stats_error_parsing:
goto out;
}
 
-   /* Allocate buffer for check requests... */
-   if ((newsrv->check.bi = calloc(sizeof(struct buffer) + 
global.tune.chksize, sizeof(char))) == NULL) {
-   Alert("parsing [%s:%d] : out of memory while 
allocating check buffer.\n", file, linenum);
-   err_code |= ERR_ALERT | ERR_ABORT;
-   goto out;
-   }
-   newsrv->check.bi->size = global.tune.chksize;
-
-   /* Allocate buffer for check responses... */
-   if ((newsrv->check.bo = calloc(sizeof(struct buffer) + 
global.tune.chksize, sizeof(char))) == NULL) {
-   Alert("parsing [%s:%d] : out of memory while 
allocating check buffer.\n", file, linenum);
-   err_code |= ERR_ALERT | ERR_ABORT;
-   goto out;
-   }
-   newsrv->check.bo->size = global.tune.chksize;
-
-   /* Allocate buffer for partial check results... */
-   if ((newsrv->check.conn = calloc(1, sizeof(struct 
connection))) == NULL) {
-   Alert("parsing [%s:%d] : out of memory while 
allocating check connection.\n", file, linenum);
-   err_code |= ERR_ALERT | ERR_ABORT;
+   ret = init_check(newsrv, &newsrv->check, file, linenum);
+   if (ret) {
+   err_code |= ret;
goto out;
}
 
-   newsrv->check.conn->t.sock.fd = -1; /* no check in 
progress yet */
-   newsrv->check.status = HCHK_STATUS_INI;
-   newsrv->check.server = newsrv;
newsrv->state |= SRV_CHECKED;
}
 
-- 
1.7.10.4




[PATCH 05/13] MEDIUM: Move result element to struct check

2013-02-25 Thread Simon Horman
Move result element from struct server to struct check
This allows check results to be independent of the check's server.

This is in preparation for associating a agent check
with a server which runs as well as the server's existing check.

Signed-off-by: Simon Horman 
---
 include/types/server.h |2 +-
 src/checks.c   |   50 
 2 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/include/types/server.h b/include/types/server.h
index 1ed7e90..ac5903d 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -116,6 +116,7 @@ struct check {
int use_ssl;/* use SSL for health checks */
int send_proxy; /* send a PROXY protocol header 
with checks */
int inter, fastinter, downinter;/* checks: time in milliseconds 
*/
+   int result; /* health-check result : 
SRV_CHK_* */
struct server *server;  /* back-pointer to server */
 };
 
@@ -154,7 +155,6 @@ struct server {
short onmarkeddown; /* what to do when marked down: 
one of HANA_ONMARKEDDOWN_* */
short onmarkedup;   /* what to do when marked up: 
one of HANA_ONMARKEDUP_* */
int slowstart;  /* slowstart time in seconds 
(ms in the conf) */
-   int result; /* health-check result : 
SRV_CHK_* */
 
char *id;   /* just for identification */
unsigned iweight,uweight, eweight;  /* initial weight, 
user-specified weight, and effective weight */
diff --git a/src/checks.c b/src/checks.c
index b04aa9d..aa48ab4 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -194,7 +194,7 @@ static void server_status_printf(struct chunk *msg, struct 
server *s, unsigned o
 }
 
 /*
- * Set s->check.status, update s->check.duration and fill s->result with
+ * Set s->check.status, update s->check.duration and fill s->check.result with
  * an adequate SRV_CHK_* value.
  *
  * Show information in logs about failed health check if server is UP
@@ -203,7 +203,7 @@ static void server_status_printf(struct chunk *msg, struct 
server *s, unsigned o
 static void set_server_check_status(struct server *s, short status, const char 
*desc)
 {
if (status == HCHK_STATUS_START) {
-   s->result = SRV_CHK_UNKNOWN;/* no result yet */
+   s->check.result = SRV_CHK_UNKNOWN;  /* no result yet */
s->check.desc[0] = '\0';
s->check.start = now;
return;
@@ -220,7 +220,7 @@ static void set_server_check_status(struct server *s, short 
status, const char *
 
s->check.status = status;
if (check_statuses[status].result)
-   s->result = check_statuses[status].result;
+   s->check.result = check_statuses[status].result;
 
if (status == HCHK_STATUS_HANA)
s->check.duration = -1;
@@ -231,10 +231,10 @@ static void set_server_check_status(struct server *s, 
short status, const char *
}
 
if (s->proxy->options2 & PR_O2_LOGHCHKS &&
-   (((s->health != 0) && (s->result & SRV_CHK_FAILED)) ||
-   ((s->health != s->rise + s->fall - 1) && (s->result & 
SRV_CHK_PASSED)) ||
-   ((s->state & SRV_GOINGDOWN) && !(s->result & SRV_CHK_DISABLE)) ||
-   (!(s->state & SRV_GOINGDOWN) && (s->result & SRV_CHK_DISABLE {
+   (((s->health != 0) && (s->check.result & SRV_CHK_FAILED)) ||
+   ((s->health != s->rise + s->fall - 1) && (s->check.result & 
SRV_CHK_PASSED)) ||
+   ((s->state & SRV_GOINGDOWN) && !(s->check.result & 
SRV_CHK_DISABLE)) ||
+   (!(s->state & SRV_GOINGDOWN) && (s->check.result & 
SRV_CHK_DISABLE {
 
int health, rise, fall, state;
 
@@ -246,7 +246,7 @@ static void set_server_check_status(struct server *s, short 
status, const char *
fall   = s->fall;
state  = s->state;
 
-   if (s->result & SRV_CHK_FAILED) {
+   if (s->check.result & SRV_CHK_FAILED) {
if (health > rise) {
health--; /* still good */
} else {
@@ -257,7 +257,7 @@ static void set_server_check_status(struct server *s, short 
status, const char *
}
}
 
-   if (s->result & SRV_CHK_PASSED) {
+   if (s->check.result & SRV_CHK_PASSED) {
if (health < rise + fall - 1) {
health++; /* was bad, stays for a while */
 
@@ -278,8 +278,8 @@ static void set_server_check_status(struct server *s, short 
status, const char *
 "Health check for %sserver %s/%s %s%s",
 s->state & SRV_BACKUP ? "backup " : "",
 s->proxy->id, s->id,
- 

[PATCH 09/13] MEDIUM: Add name element to struct check

2013-02-25 Thread Simon Horman
This is in preparation for associating a agent check
with a server which runs as well as the server's existing check.

Signed-off-by: Simon Horman 
---
 include/types/server.h |1 +
 src/cfgparse.c |5 +++--
 src/checks.c   |2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/types/server.h b/include/types/server.h
index f6d98a2..97e09ca 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -120,6 +120,7 @@ struct check {
int inter, fastinter, downinter;/* checks: time in milliseconds 
*/
int result; /* health-check result : 
SRV_CHK_* */
int state;  /* health-check result : CHK_* 
*/
+   const char *name;   /* Name of check: "Health" or 
"Agent" */
struct server *server;  /* back-pointer to server */
 };
 
diff --git a/src/cfgparse.c b/src/cfgparse.c
index c23a48d..d5c59d9 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -1619,7 +1619,7 @@ out:
return err_code;
 }
 
-static int init_check(struct server *s, struct check *check, const char * 
file, int linenum)
+static int init_check(struct server *s, const char *name, struct check *check, 
const char * file, int linenum)
 {
/* Allocate buffer for requests... */
if ((check->bi = calloc(sizeof(struct buffer) + global.tune.chksize, 
sizeof(char))) == NULL) {
@@ -1644,6 +1644,7 @@ static int init_check(struct server *s, struct check 
*check, const char * file,
check->conn->t.sock.fd = -1; /* no agent in progress yet */
check->status = HCHK_STATUS_INI;
check->server = s;
+   check->name = name;
 
return 0;
 }
@@ -4747,7 +4748,7 @@ stats_error_parsing:
goto out;
}
 
-   ret = init_check(newsrv, &newsrv->check, file, linenum);
+   ret = init_check(newsrv, "Health", &newsrv->check, 
file, linenum);
if (ret) {
err_code |= ret;
goto out;
diff --git a/src/checks.c b/src/checks.c
index 700397a..0379ac2 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -274,7 +274,7 @@ static void set_server_check_status(struct check *check, 
short status, const cha
/* FIXME end: calculate local version of the 
health/rise/fall/state */
 
chunk_appendf(&trash,
-"Health check for %sserver %s/%s %s%s",
+"%s check for %sserver %s/%s %s%s", check->name,
 s->state & SRV_BACKUP ? "backup " : "",
 s->proxy->id, s->id,
 (check->result & SRV_CHK_DISABLE)?"conditionally 
":"",
-- 
1.7.10.4




[PATCH 01/13] DOC: Clarify documentation of option lb-agent-chk

2013-02-25 Thread Simon Horman
Avoid referring to check-port as this is not a configuration parameter.

Signed-off-by: Simon Horman 
---
 doc/configuration.txt |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/configuration.txt b/doc/configuration.txt
index 70a5188..28c5223 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -3766,10 +3766,10 @@ option lb-agent-chk
 
 This currently has the same behaviour as down (iii).
 
-  The use of an alternate check-port, used to obtain agent heath check
-  information described above as opposed to the port of the service, may be
-  useful in conjunction with this option.
-
+  The use of the port parameter to a server may in conjunction with this
+  option be used to set the TCP port used to obtain agent heath check
+  information described above. Otherwise the port of the serivce will be
+  used.
 
 option ldap-check
   Use LDAPv3 health checks for server testing
-- 
1.7.10.4




[PATCH 04/13] MEDIUM: Move {,fast,down}inter to struct check

2013-02-25 Thread Simon Horman
Move {,fast,down}inter elements from struct server to struct check.
This allows those elements of a check to be independent of the check's server.

This is in preparation for associating a agent check
with a server which runs as well as the server's existing check.

Signed-off-by: Simon Horman 
---
 include/types/server.h |2 +-
 src/cfgparse.c |   18 +-
 src/checks.c   |   10 +-
 src/server.c   |6 +++---
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/include/types/server.h b/include/types/server.h
index c8b2766..1ed7e90 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -115,6 +115,7 @@ struct check {
char desc[HCHK_DESC_LEN];   /* health check descritpion */
int use_ssl;/* use SSL for health checks */
int send_proxy; /* send a PROXY protocol header 
with checks */
+   int inter, fastinter, downinter;/* checks: time in milliseconds 
*/
struct server *server;  /* back-pointer to server */
 };
 
@@ -152,7 +153,6 @@ struct server {
short observe, onerror; /* observing mode: one of 
HANA_OBS_*; what to do on error: on of ANA_ONERR_* */
short onmarkeddown; /* what to do when marked down: 
one of HANA_ONMARKEDDOWN_* */
short onmarkedup;   /* what to do when marked up: 
one of HANA_ONMARKEDUP_* */
-   int inter, fastinter, downinter;/* checks: time in milliseconds 
*/
int slowstart;  /* slowstart time in seconds 
(ms in the conf) */
int result; /* health-check result : 
SRV_CHK_* */
 
diff --git a/src/cfgparse.c b/src/cfgparse.c
index f7af294..62a0b54 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -1330,9 +1330,9 @@ void init_default_instance()
defproxy.maxconn = cfg_maxpconn;
defproxy.conn_retries = CONN_RETRIES;
 
-   defproxy.defsrv.inter = DEF_CHKINTR;
-   defproxy.defsrv.fastinter = 0;
-   defproxy.defsrv.downinter = 0;
+   defproxy.defsrv.check.inter = DEF_CHKINTR;
+   defproxy.defsrv.check.fastinter = 0;
+   defproxy.defsrv.check.downinter = 0;
defproxy.defsrv.rise = DEF_RISETIME;
defproxy.defsrv.fall = DEF_FALLTIME;
defproxy.defsrv.check.port = 0;
@@ -4124,9 +4124,9 @@ stats_error_parsing:
 
newsrv->check.use_ssl = curproxy->defsrv.check.use_ssl;
newsrv->check.port  = curproxy->defsrv.check.port;
-   newsrv->inter   = curproxy->defsrv.inter;
-   newsrv->fastinter   = curproxy->defsrv.fastinter;
-   newsrv->downinter   = curproxy->defsrv.downinter;
+   newsrv->check.inter = curproxy->defsrv.check.inter;
+   newsrv->check.fastinter = 
curproxy->defsrv.check.fastinter;
+   newsrv->check.downinter = 
curproxy->defsrv.check.downinter;
newsrv->rise= curproxy->defsrv.rise;
newsrv->fall= curproxy->defsrv.fall;
newsrv->maxqueue= curproxy->defsrv.maxqueue;
@@ -4214,7 +4214,7 @@ stats_error_parsing:
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
-   newsrv->inter = val;
+   newsrv->check.inter = val;
cur_arg += 2;
}
else if (!strcmp(args[cur_arg], "fastinter")) {
@@ -4231,7 +4231,7 @@ stats_error_parsing:
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
-   newsrv->fastinter = val;
+   newsrv->check.fastinter = val;
cur_arg += 2;
}
else if (!strcmp(args[cur_arg], "downinter")) {
@@ -4248,7 +4248,7 @@ stats_error_parsing:
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
-   newsrv->downinter = val;
+   newsrv->check.downinter = val;
cur_arg += 2;
}
else if (!defsrv && !strcmp(args[cur_arg], "addr")) {
diff --git a/src/checks.c b/src/checks.c
index f35abaf..b04aa9d 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -692,8 +692,8 @@ void health_adjust(struct server *s, short status)
s->consecutive_errors = 0;
s->counters.failed_hana++;
 
-   if (s->f

[PATCH 03/13] MEDIUM: Split up struct server's check element

2013-02-25 Thread Simon Horman
This is in preparation for associating a agent check
with a server which runs as well as the server's existing check.

The split has been made by:
* Moving elements of struct server's check element that will
  be shared by both checks into a new check_common element
  of struct server.
* Moving the remaining elements to a new struct check and
  making struct server's check element a struct check.
* Adding a server element to struct check, a back-pointer
  to the server element it is a member of.
  - At this time the server could be obtained using
container_of, however, this will not be so easy
once a second struct check element is added to struct server
to accommodate an agent health check.

Signed-off-by: Simon Horman 
---
 include/types/server.h |   31 +++
 src/cfgparse.c |   15 ---
 src/checks.c   |   10 +-
 3 files changed, 32 insertions(+), 24 deletions(-)

diff --git a/include/types/server.h b/include/types/server.h
index b58a062..c8b2766 100644
--- a/include/types/server.h
+++ b/include/types/server.h
@@ -103,6 +103,21 @@ struct tree_occ {
struct eb32_node node;
 };
 
+struct check {
+   struct connection *conn;/* connection state for health 
checks */
+
+   short port; /* the port to use for the 
health checks */
+   struct buffer *bi, *bo; /* input and output buffers to 
send/recv check */
+   struct task *task;  /* the task associated to the 
health check processing, NULL if disabled */
+   struct timeval start;   /* last health check start time 
*/
+   long duration;  /* time in ms took to finish 
last health check */
+   short status, code; /* check result, check code */
+   char desc[HCHK_DESC_LEN];   /* health check descritpion */
+   int use_ssl;/* use SSL for health checks */
+   int send_proxy; /* send a PROXY protocol header 
with checks */
+   struct server *server;  /* back-pointer to server */
+};
+
 struct server {
enum obj_type obj_type; /* object type == 
OBJ_TYPE_SERVER */
struct server *next;
@@ -163,21 +178,13 @@ struct server {
 
int puid;   /* proxy-unique server ID, used 
for SNMP, and "first" LB algo */
 
-   struct {/* health-check specific 
configuration */
-   struct connection *conn;/* connection state for health 
checks */
+   struct {/* configuration  used by 
halth-check and agent-check */
struct protocol *proto; /* server address protocol for 
health checks */
struct xprt_ops *xprt;  /* transport layer operations 
for health checks */
struct sockaddr_storage addr;   /* the address to check, if 
different from  */
-   short port; /* the port to use for the 
health checks */
-   struct buffer *bi, *bo; /* input and output buffers to 
send/recv check */
-   struct task *task;  /* the task associated to the 
health check processing, NULL if disabled */
-   struct timeval start;   /* last health check start time 
*/
-   long duration;  /* time in ms took to finish 
last health check */
-   short status, code; /* check result, check code */
-   char desc[HCHK_DESC_LEN];   /* health check descritpion */
-   int use_ssl;/* use SSL for health checks */
-   int send_proxy; /* send a PROXY protocol header 
with checks */
-   } check;
+   } check_common;
+
+   struct check check; /* health-check specific 
configuration */
 
 #ifdef USE_OPENSSL
int use_ssl;/* ssl enabled */
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 1a2fc8a..f7af294 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -4112,8 +4112,8 @@ stats_error_parsing:
}
 
newsrv->addr = *sk;
-   newsrv->proto = newsrv->check.proto = 
protocol_by_family(newsrv->addr.ss_family);
-   newsrv->xprt  = newsrv->check.xprt  = &raw_sock;
+   newsrv->proto = newsrv->check_common.proto = 
protocol_by_family(newsrv->addr.ss_family);
+   newsrv->xprt  = newsrv->check_common.xprt  = &raw_sock;
 
if (!newsrv->proto) {
Alert("parsing [%s:%d] : Unknown protocol 
family %d '%s'\n",
@@ -4122,7 +4122,7 @@ stats_error_parsing:
goto out;
}
 
-  

[PATCH 00/13] checks: Add supplementary agent checks

2013-02-25 Thread Simon Horman
This patch set adds two new server parameters, "agent-port" and
"agent-interval". These may be used to control running an agent check
as well as a (non-agent) health check.

Some details of how this may be configured may be found in the changelog
of the last patch of the series.

>From an implementation point-of-view the approach taken has been to allow a
server to have two checks. One for the health checks that have been
configurable up to now. And another for an agent check.  As such most of
the series involves refactoring struct server and and code paths in
checks.c to separate a server from its check. It is only the last patch
that actually adds the second check.

Simon Horman (13):
  DOC: Clarify documentation of option lb-agent-chk
  CLEANUP: Make parameters of srv_downtime and srv_getinter const
  MEDIUM: Split up struct server's check element
  MEDIUM: Move {,fast,down}inter to struct check
  MEDIUM: Move result element to struct check
  MEDIUM: Paramatise functions over the check of a server
  MEDIUM: cfgparse: Factor out check initialisation
  MEDIUM: Add state to struct check
  MEDIUM: Add name element to struct check
  MEDIUM: Move health element to struct check
  MEDIUM: Add type type to struct check
  MEDIUM: Add helper for task creation for checks
  MEDIUM: checks: Add supplementary agent checks

 doc/configuration.txt  |   67 --
 include/proto/checks.h |4 +-
 include/proto/server.h |4 +-
 include/types/server.h |   46 ++--
 src/cfgparse.c |  154 +
 src/checks.c   |  592 
 src/dumpstats.c|   22 +-
 src/haproxy.c  |6 +
 src/proto_http.c   |6 +-
 src/server.c   |   16 +-
 10 files changed, 534 insertions(+), 383 deletions(-)

-- 
1.7.10.4




[PATCH 02/13] CLEANUP: Make parameters of srv_downtime and srv_getinter const

2013-02-25 Thread Simon Horman
The parameters of srv_downtime and srv_getinter are not modified
and thus may be const.

Signed-off-by: Simon Horman 
---
 include/proto/server.h |4 ++--
 src/server.c   |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/proto/server.h b/include/proto/server.h
index ded640a..b2df045 100644
--- a/include/proto/server.h
+++ b/include/proto/server.h
@@ -32,8 +32,8 @@
 #include 
 #include 
 
-int srv_downtime(struct server *s);
-int srv_getinter(struct server *s);
+int srv_downtime(const struct server *s);
+int srv_getinter(const struct server *s);
 
 /* increase the number of cumulated connections on the designated server */
 static void inline srv_inc_sess_ctr(struct server *s)
diff --git a/src/server.c b/src/server.c
index 98a9fbe..e542bb7 100644
--- a/src/server.c
+++ b/src/server.c
@@ -22,7 +22,7 @@ static struct srv_kw_list srv_keywords = {
.list = LIST_HEAD_INIT(srv_keywords.list)
 };
 
-int srv_downtime(struct server *s)
+int srv_downtime(const struct server *s)
 {
if ((s->state & SRV_RUNNING) && s->last_change < now.tv_sec)
// ignore negative time
return s->down_time;
@@ -30,7 +30,7 @@ int srv_downtime(struct server *s)
return now.tv_sec - s->last_change + s->down_time;
 }
 
-int srv_getinter(struct server *s)
+int srv_getinter(const struct server *s)
 {
if ((s->state & SRV_CHECKED) && (s->health == s->rise + s->fall - 1))
return s->inter;
-- 
1.7.10.4




[PATCH] MEDIUM: systemd-wrapper: don't leak zombie processes

2013-02-25 Thread Marc-Antoine Perennou
Formerly, if A was replaced by B, and then B by C before
A finished exiting, we didn't wait for B to finish so it
ended up as a zombie process.
Fix this by queuing all process we spawn for waitpid.

Signed-off-by: Marc-Antoine Perennou 
---
 src/haproxy-systemd-wrapper.c | 45 +--
 1 file changed, 43 insertions(+), 2 deletions(-)

diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c
index 57e8d7d..3c70271 100644
--- a/src/haproxy-systemd-wrapper.c
+++ b/src/haproxy-systemd-wrapper.c
@@ -24,6 +24,44 @@ static char *pid_file = "/run/haproxy.pid";
 static int main_argc;
 static char **main_argv;
 
+static struct {
+   pid_t *queue;
+   int count;
+   int size;
+   int index;
+   int rindex;
+} pids = {
+   .queue = NULL,
+   .count = 0,
+   .size = 8,
+   .index = 0,
+   .rindex = 0
+};
+
+static void pids_push(pid_t pid)
+{
+   if (pids.size == pids.count) {
+   // Double the capacity, write in the new half, rewind reading 
head
+   pids.index = pids.size;
+   pids.rindex = 0;
+   pids.size *= 2;
+   pids.queue = realloc(pids.queue, pids.size * sizeof(int));
+   }
+   pids.queue[pids.index++ % pids.size] = pid;
+   pids.count++;
+}
+
+static bool pids_pop(void)
+{
+   if (pids.count == 0)
+   pid = 0;
+   else {
+   pids.count--;
+   pid = pids.queue[pids.rindex++ % pids.size];
+   }
+   return pid != 0;
+}
+
 static pid_t spawn_haproxy(char **pid_strv, int nb_pid)
 {
pid_t pid = fork();
@@ -76,7 +114,7 @@ static void signal_handler(int signum 
__attribute__((unused)))
char **pid_strv = NULL;
int nb_pid = read_pids(&pid_strv);
 
-   pid = spawn_haproxy(pid_strv, nb_pid);
+   pids_push(spawn_haproxy(pid_strv, nb_pid));
 
for (i = 0; i < nb_pid; ++i)
free(pid_strv[i]);
@@ -106,8 +144,11 @@ int main(int argc, char **argv)
 
signal(SIGUSR2, &signal_handler);
 
+   pids.queue = malloc(pids.size * sizeof(int));
pid = spawn_haproxy(NULL, 0);
-   while (-1 != waitpid(pid, NULL, 0) || errno == EINTR);
+   while ((-1 != waitpid(pid, NULL, 0) || errno == EINTR) && pids_pop());
+
+   free(pids.queue);
 
return EXIT_SUCCESS;
 }
-- 
1.8.1.3




Re: Failed to persist on SSL session ID

2013-02-25 Thread bobby1

Emeric BRUN  writes:

> 
> 
>  Ki,
> 
> original message-
> De: "Godbach" nylzhaowei@...
> A: "Emeric BRUN" ebrun@...
> Copie à: haproxy@...
> Date: Mon, 21 Jan 2013 11:46:46 +0800
> -
> 
>  
> > Hi, Emeric
> > 
> > Thank you for your suggestion.
> > 
> > There are some codes implemented for ssl session cache in haproxy
> > indeed. But I cannot find the implementation of the option
> > stick on ssl_session_id
> > either in dev16 or dev17.
> > 
> > And haproxy failed to start with 'stick on ssl_session_id' set in
> > configuration file. The error information as below:
> > [ALERT] 020/114500 (29257) : parsing [h-ssl.cfg:33] : 'stick':
> > unknown fetch method 'ssl_session_id'.
> 
> Sorry,
> 
> stick on ssl_fc_session_id
> 
> > 
> > 
> > Best Regards,
> > Godbach

Hi Godbach,

Am trying ssl_fc_session_id using 1.5dev17, and I am getting this error also.  

[ALERT] 055/105232 (25450) : parsing [haproxy.cfg.sslfcsessionid:37] : 'stick': 
unknown fetch method 'ssl_fc_session_id'.

My config is:


backend appSrv1
mode tcp
balance roundrobin

stick-table type string len 32 size 30k expire 15m
stick on ssl_fc_session_id

server s1 *:443
server s2 *:443

Do I need to add any parameters in the compile to get the method working?

Thanks,
Bobby1