How to upgrade HAProxy

I created a BASH Script to automate the Build Process for HAProxy on CentOS 7. It is here: https://github.com/ronnie-lazarus/Shell-Scripts/tree/master/HAProxy%20Build%20(with%20LUA)%20over%20CentOS%207

I’ve been using this for all my server installs. However, the question I always had in my mind was how to upgrade if I ever needed it. Do I just compile the new binaries and replaces the sbin directory? What would be the specifics? Any help is much appreciated.

Thanks,

make install and restarting the process suffices.

I see. Sorry for the extremely specific question but basically I re-download the source code, extract it, and do:

make USE_NS=1 USE_TFO=1 USE_OPENSSL=1 USE_ZLIB=1 USE_LUA=1 USE_PCRE=1 USE_SYSTEMD=1 USE_LIBCRYPT=1 USE_THREAD=1 TARGET=linux-glibc EXTRA_OBJS=“contrib/prometheus-exporter/service-prometheus.o” LUA_INC=$lualocalinstalldir/include LUA_LIB=$lualocalinstalldir/lib && make install

And this will basically not just recompile but also replace every single binary that gets created through the process without any conflict?

Also, what would your thoughts be on my script? Care to comment?

Thanks,

Yes, unless the old release has binaries that the new release has not. For example 1.7 has haproxy-systemd-wrapper which is removed from 1.8+. But make install from 1.8 wont do anything about the old haproxy-systemd-wrapper.

Also, a part from the binaries, every other step has to be done also, like updating the unit file for systemd. So your script needs to take care of that, just like it needs to take care to not do the same thing multiple times.

Like if you run your script 5 times, how does the rsyslog configuration looks like, does it have 5 times the logging config?

Not sure why you would need to build on every box, as opposed to just build a rpm once and use that, but I admit I don’t know your specific use-case.

Yes, I have taken this into consideration. My script will not initialize in case an existing install (I understand this term can be very vague) is detected. And every command put in there will basically just overwrite or create new files. Thanks for your suggestions however though.

This is simply because I’ve never built an RPM yet :slight_smile: I am however very much encouraged with your suggestion and I feel that it should be my next best step. Though I wonder why hasn’t anybody just already done that yet? Would you happen to have some leads on it? I do know of the Enterprise version, however.

And once again I would like to extend my deepest thanks to you and the developers of such a robust tool and keeping it open source as well as continuously helping us folks with all of our doubts. If possible I would definitely want to add to the community somehow maybe by building that RPM you just talked about if it isn’t already there :slight_smile:

I never build an RPM either, I don’t know the process (I just think it’s the right tool for the job).

Maybe this can help:

https://rpm-packaging-guide.github.io/