Hi Saul,

On Wed, Sep 19, 2012 at 03:10:03PM -0400, Saul wrote:
> Here is a simple script i use to update my HAproxy servers, the logic is
> simple and I always keep the previous versions in case i need to roll back,
> basically  build from source with the latest stable release and replace the
> current haproxy, all your init scripts will continue to work.
> 
> cd /tmp/
> wget http://haproxy.1wt.eu/download/latest/version.tar.gz
> tar -xvzf haproxy-*cd haproxy-(version)
> make TARGET=linux26 USE_PCRE=1 > replace the make with whatever fits your 
> needs
> mv /usr/sbin/haproxy /usr/sbin/haproxy_v.X.X  > keeps an old copy of the 
> version
> cp haproxy /usr/sbin/haproxy > your distro may be different
> /etc/init.d/haproxy restart > or whatever init script you have..

I know some people who do a very close variant. They install the
binary with the version in its name, then make haproxy a symlink
to the version. That way, it's even easier to revert in case of
issues :

    cp haproxy /usr/sbin/haproxy-1.5-dev12
    ln -sf haproxy-1.5-dev12 /usr/sbin/haproxy

I'm doing that myself too on the main site BTW, except that since
I regularly install test versions, I have a more complex naming
scheme :-)

Also, you can use "reload" instead of "restart" to replace the
process. The difference is that upon "reload", the old process
will go away only if the new one managed to start without error.
This can avoid service outages !

Regards,
Willy


Reply via email to