Hi Brian

Thanks!
I wish there was a built-in feature in haproxy to reload on config change. That 
would make a lot of people happy.
Maybe I’ll open an issue for that.

Regarding USR2 - 
1) Are you sure it’s not USR1 ?
2) If I understand correctly, then what you’re saying would cause the unit to 
exit (fail?) (since the main process will exit) and systemd would be expected 
to start another wrapper. Assuming that the worker processes are still there, 
then this is sure to create zombies, which beats the purpose of having a wrapper

Regards,
Yaron Rosenbaum
Founder and CTO
MultiCloud
M +972 54 2346012
www.multicloud.io <http://www.multicloud.io/>
> On Jan 20, 2015, at 8:47 PM, Bryan Talbot <[email protected]> wrote:
> 
> I think that the recommended way to restart when using the wrapper is to 
> signal with a HUP or USR2 to the wrapper which will take care of the 
> soft-restart of haproxy itself.
> 
> I believe that a HUP will just cause haproxy to be restarted while the USR2 
> will reload both haproxy and the wrapper binary itself.
> 
> The sample unit file in contrib/systemd/haproxy.service.in 
> <http://haproxy.service.in/> is:
> 
> [Unit]
> Description=HAProxy Load Balancer
> After=network.target
> 
> [Service]
> ExecStartPre=@SBINDIR@/haproxy -f /etc/haproxy/haproxy.cfg -c -q
> ExecStart=@SBINDIR@/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p 
> /run/haproxy.pid
> ExecReload=/bin/kill -USR2 $MAINPID
> KillMode=mixed
> Restart=always
> 
> [Install]
> WantedBy=multi-user.target
> 
> 
> On Tue, Jan 20, 2015 at 1:38 AM, Yaron Rosenbaum <[email protected] 
> <mailto:[email protected]>> wrote:
> Hi
> 
> Adding the -sf flag to haproxy-systemd-wrapper causes it to exit and print 
> usage info.
> (-sf <pid>  does the same).
> Haproxy 1.5.8, debian wheezy.
> 
> Is this a known issue? am I using it incorrectly?
> I’m assuming a reload would be issuing the same command (with pids after -sf)
> 
> Thanks.
> 
> root# haproxy-systemd-wrapper -f /opt/multicloud/discovery/haproxy.cfg -D -p 
> /var/run/haproxy.pid  -sf 
> <7>haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f 
> /opt/multicloud/discovery/haproxy.cfg -D -p /var/run/haproxy.pid -sf -Ds 
> HA-Proxy version 1.5.8 2014/10/31
> Copyright 2000-2014 Willy Tarreau <[email protected] <mailto:[email protected]>>
> 
> Usage : haproxy [-f <cfgfile>]* [ -vdVD ] [ -n <maxconn> ] [ -N <maxpconn> ]
>         [ -p <pidfile> ] [ -m <max megs> ] [ -C <dir> ]
>         -v displays version ; -vv shows known build options.
>         -d enters debug mode ; -db only disables background mode.
>         -dM[<byte>] poisons memory with <byte> (defaults to 0x50)
>         -V enters verbose mode (disables quiet mode)
>         -D goes daemon ; -C changes to <dir> before loading files.
>         -q quiet mode : don't display messages
>         -c check mode : only check config files and exit
>         -n sets the maximum total # of connections (2000)
>         -m limits the usable amount of memory (in MB)
>         -N sets the default, per-proxy maximum # of connections (2000)
>         -L set local peer name (default to hostname)
>         -p writes pids of all children to this file
>         -de disables epoll() usage even when available
>         -dp disables poll() usage even when available
>         -dS disables splice usage (broken on old kernels)
>         -dV disables SSL verify on servers side
>         -sf/-st [pid ]* finishes/terminates old pids. Must be last arguments.
> 
> <5>haproxy-systemd-wrapper: exit, haproxy RC=256
> 
> 
> (Y)
> 
> 

Reply via email to