[ANNOUNCE] haproxy 1.4.13

2011-03-09 Thread Willy Tarreau
Hi all, since Hank's report about the crash on files containing an empty pattern, I have released 1.4.13 with the fix for this regression introduced in 1.4.11 when trying to fix handling of empty lines. In the commit, I stated that I could only reproduce it with files composed only of empty

Apache Compatible HAProxy Log Formatting?

2011-03-09 Thread Joel Krauska
Has anyone worked out a way to get HAProxy to output logging in an Apache Combined Log Format? Most log analysis tools out there already speak Apache log format and I was hoping to avoid writing a parser for what is essentially mostly the same information. Anyone got a work around for this

Re: Apache Compatible HAProxy Log Formatting?

2011-03-09 Thread Hervé COMMOWICK
On Wed, 09 Mar 2011 00:40:12 -0800 Joel Krauska jkrau...@gmail.com wrote: Has anyone worked out a way to get HAProxy to output logging in an Apache Combined Log Format? Most log analysis tools out there already speak Apache log format and I was hoping to avoid writing a parser for what is

mode tcp with mode http/shoutcast radio issue

2011-03-09 Thread Florescu, Dan Alexandru
Hello, I'm trying to use: frontend front mode http and backend web mode http backend radio mode tcp But will error with Unable to use proxy with wrong mode, required: http, has: tcp. Ok, this is understandable, so I changed to: frontend front mode tcp and backend web mode http backend

Re: Script greasmonkey to navigate in Haproxy docs ...

2011-03-09 Thread Tommaso Lanza
Ignoring the fact that some else (http://www.mail-archive.com/haproxy@formilux.org/msg02764.html) had a similar idea, I pushed a public Git repo of the docs in Markdown format. I've only used a few simple regexes, which I lazily dumped in the repo as well, as well as a healthy dose of manual

Re: Apache Compatible HAProxy Log Formatting?

2011-03-09 Thread Willy Tarreau
On Wed, Mar 09, 2011 at 01:10:12AM -0800, Joel Krauska wrote: On 3/9/11 1:03 AM, Graeme Donaldson wrote: 2011/3/9 Hervé COMMOWICKhcommow...@exceliance.fr: http://haproxy.1wt.eu/download/1.4/doc/configuration.txt option httplog [ clf ] Enable logging of HTTP request, session state and

[PATCH 04/26] Reap children

2011-03-09 Thread Simon Horman
In the master/worker the workers will be child processes of the master and should be reaped after they exit. --- src/haproxy.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index 3fe8889..99d8c0d 100644 --- a/src/haproxy.c +++

[PATCH 02/26] Add a socket cache

2011-03-09 Thread Simon Horman
When a socket is closed, typically because a proxy is deleted, don't close the file descriptor. Rather keep a cache which can be looked-up and used when a subsequent proxy is started. The aim is to avoid unbinding and binding to ports and thus interrupting services unnecessarily. This will be

[PATCH 06/26] Add vAlert and vWarning

2011-03-09 Thread Simon Horman
--- include/proto/log.h | 12 src/log.c | 35 --- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/include/proto/log.h b/include/proto/log.h index f2ecf0b..45bec88 100644 --- a/include/proto/log.h +++ b/include/proto/log.h

[PATCH 07/26] Add is_master flag

2011-03-09 Thread Simon Horman
This is in preparation for adding Master/Worker mode --- src/haproxy.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index 99d8c0d..1f02902 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -136,6 +136,9 @@ struct global global = {

[PATCH 09/26] Clean up logger on deinit()

2011-03-09 Thread Simon Horman
This will allow new logging configuration to take effect once changes to reinitialise haproxy are introduced. --- include/proto/log.h |5 + src/haproxy.c |1 + src/log.c | 17 ++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git

[PATCH 12/26] Free global.chroot earlier

2011-03-09 Thread Simon Horman
--- src/haproxy.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index dc2739b..8c9053f 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -1131,6 +1131,7 @@ void run(int argc, char **argv) } chdir(/);

[PATCH 14/26] Allow pollers to be initialised multiple times

2011-03-09 Thread Simon Horman
--- src/ev_epoll.c |2 +- src/ev_kqueue.c |1 - src/ev_poll.c |1 - src/ev_select.c |1 - src/ev_sepoll.c |4 +++- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ev_epoll.c b/src/ev_epoll.c index b976868..f55a382 100644 --- a/src/ev_epoll.c +++

[PATCH 08/26] Conditionally ignore errors when resolving users and groups

2011-03-09 Thread Simon Horman
If is_master is set then the configuration is being read as part a reinitialisation. And as such it seems reasonable to ignore errors when resolving users and groups - if they are unchanged from the original configuration then they will already be set, and otherwise they may not be settable as the

[PATCH 11/26] Move chroot much earlier

2011-03-09 Thread Simon Horman
This allows chroot to occur before setsid_early(). In the case where a master process is re-initialised * It will not chroot itself, though if it is already chrooted that will remain in effect. * If it is already chrooted then the path to the configuration file read during reinitialisation

[PATCH 16/26] Restart master process on SIGUSR2

2011-03-09 Thread Simon Horman
If worker/master mode is active and the master process receives a SIGUSR2 then it will restart haproxy by re-reading the configuration file, killing existing workers and starting new workers. SIGUSR2 is ignored if worker/master mode is not active. SIGUSR2 is ignored by worker processes. ---

[PATCH 22/26] Write pid file if master/worker mode is active

2011-03-09 Thread Simon Horman
If master/worker mode is active then there will be multiple processes present and as such it is useful to know the relevant pids. This also splits run() up into two parts which will aid later refactoring. --- src/haproxy.c | 43 +++ 1 files changed, 27

[PATCH 21/26] Exit workers if the master disappears

2011-03-09 Thread Simon Horman
This should allow the master to be restarted, for instance using ruinit, if it exits for some reason. --- src/haproxy.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index 175d3e8..998c4ff 100644 --- a/src/haproxy.c +++

[PATCH 17/26] Exit master proxies as soon as possible

2011-03-09 Thread Simon Horman
--- src/proxy.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/proxy.c b/src/proxy.c index c4f452c..ff5f635 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -575,9 +575,10 @@ void soft_stop(void) tv_update_date(0,1); /* else, the old time before select

[PATCH 20/26] Document master/worker mode

2011-03-09 Thread Simon Horman
Note: I have not updated the French documentation --- doc/configuration.txt | 48 ++-- doc/haproxy-en.txt| 47 ++- doc/haproxy.1 | 20 ++-- 3 files changed, 94 insertions(+),

[PATCH 15/26] Add master/worker model

2011-03-09 Thread Simon Horman
A master process is detached from the terminal and then spawns worker processes. The master does nothing but waits for a signal on which it will kill its workers. A later patch will allow for restarting the workers. To facilitate this the master keeps all bound sockets open and by using the

[PATCH 19/26] Add restart (-sr)

2011-03-09 Thread Simon Horman
This works similarly to -sf and -st except that rather than terminating processes and then starting a new haproxy instance is requests a restart and then exits. --- src/haproxy.c | 17 ++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/haproxy.c

[PATCH 24/26] Write pidfile after spawning all workers

2011-03-09 Thread Simon Horman
This is to allow the pidfile to be more easily rewritten if the pid a worker changes --- src/haproxy.c | 19 ++- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index 35ee06e..c33c072 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@

[PATCH 23/26] Break out process creation

2011-03-09 Thread Simon Horman
Break out the portion of run() that forks processes into create_processes() and move the remainder of run() back into main(). This increases readability by 1) reducing the indentation of almost all of the code in create_processes() 2) Removing the arbitrary split between run() and main(). It

Re: [PATCH 00/26] Restart of haproxy without dropping connections

2011-03-09 Thread Simon Horman
On Thu, Mar 10, 2011 at 01:32:42PM +0900, Simon Horman wrote: Hi, this patch series attempts to allow haproxy to be restarted - perhaps reconfigured would be a better term - without refusing or dropping connections. The model that I am using is that of a master process, which really does

How to delete a node in EB Tree

2011-03-09 Thread xiaoxin
Hello: I am try to delete the proxy because some task. and reload the new proxy. and then use check_config_validity. but I get the problem that I use the fallowing code in delete_proxy() (custom function) /* p = proxy */ 786

Re: [PATCH 00/26] Restart of haproxy without dropping connections

2011-03-09 Thread Willy Tarreau
Hi Simon, On Thu, Mar 10, 2011 at 01:32:42PM +0900, Simon Horman wrote: Hi, this patch series attempts to allow haproxy to be restarted - perhaps reconfigured would be a better term - without refusing or dropping connections. Wow, I'm impressed, you managed to do that really quickly ! You

Re: How to deal with proxying shoutcast / ICY protocol

2011-03-09 Thread Willy Tarreau
Hi David, On Thu, Mar 10, 2011 at 03:36:11PM +1300, David Young wrote: I thought that if I configured haproxy in mode tcp instead of mode http, that it'd behave more like a simple loadbalancer, and just pass the request onto my squid backend verbatim, but that doesn't seem to have worked

Re: How to delete a node in EB Tree

2011-03-09 Thread Willy Tarreau
Hello, On Thu, Mar 10, 2011 at 01:59:30PM +0800, xiaoxin wrote: Hello: I am try to delete the proxy because some task. and reload the new proxy. and then use check_config_validity. but I get the problem that I use the fallowing code in delete_proxy() (custom function)

Re: [PATCH 00/26] Restart of haproxy without dropping connections

2011-03-09 Thread Simon Horman
Hi Willy, On Thu, Mar 10, 2011 at 07:29:11AM +0100, Willy Tarreau wrote: Hi Simon, On Thu, Mar 10, 2011 at 01:32:42PM +0900, Simon Horman wrote: Hi, this patch series attempts to allow haproxy to be restarted - perhaps reconfigured would be a better term - without refusing or

Re: [PATCH 00/26] Restart of haproxy without dropping connections

2011-03-09 Thread Willy Tarreau
On Thu, Mar 10, 2011 at 03:52:58PM +0900, Simon Horman wrote: Wow, I'm impressed, you managed to do that really quickly ! Thanks. Its taken quite a bit of effort to get this far. I have no doubt about that :-) In the mean time, I have a few questions which come to mind : - does the