[Pkg-haproxy-maintainers] systemd support for haproxy
Apollon Oikonomopoulos
apoikos at gmail.com
Tue Apr 22 08:09:06 UTC 2014
Hi Wasif,
On 18:24 Fri 18 Apr , Wasif Riaz Malik wrote:
> The haproxy.cfg file seems to be missing a listen section, due to
> which haproxy is unable to start after the package is installed. The status of
> haproxy in systemd becomes "failed (Result: start-limit)" because the service
> file is configured to always restart it. I don't know if this is acceptable
> behaviour but its something that I noticed.
Yes, that's true. With the traditional initscript you had to explicitly
enable haproxy via /etc/default/haproxy. This allowed us to ship an
incomplete configuration file, since the users were expected to do
manual configuration anyway.
The real problem is that there is no "default" haproxy configuration;
any configuration is site-specific so there is no point in having
haproxy listen somewhere by default.
Thus said, I think the best approach would be to not ship the
configuration file under /etc at all, but instead put it as an example
under /usr/share/doc/haproxy. The systemd unit could then check for a
configuration file with a ConditionPathExists=/etc/haproxy/haproxy.cfg.
The same can also be done with the initscript.
Also with some recent changes we pushed upstream, we will be able to
change "Restart = always" to "Restart = on-failure".
Regards,
Apollon
More information about the Pkg-haproxy-maintainers
mailing list