I have a requirement to run a couple of instances of haproxy and I need to update the haproxy.service file to add the second command / instance. Google lead me to adding the second command on the same ExecStart= option, separated by a semicolon, this didn't work.
The following made me think that I could add a second ExecStart= with the extra command, this also didn't work. http://www.freedesktop.org/software/systemd/man/systemd.service.html
How do I go about getting two instances of haproxy to run via a systemd service?
Original command
ExecStart=/usr/local/sbin/haproxy-systemd-wrapper -f /etc/haproxy.conf -p /var/run/haproxy.pid
New command
ExecStart=/usr/local/sbin/haproxy-systemd-wrapper -f /etc/haproxy.conf -p /var/run/haproxy.pid; ExecStart=/usr/local/sbin/haproxy-systemd-wrapper -f /etc/haproxy2.conf -p /var/run/haproxy2.pid
Second attempt
ExecStart=/usr/local/sbin/haproxy-systemd-wrapper -f /etc/haproxy.conf -p /var/run/haproxy.pid
ExecStart=/usr/local/sbin/haproxy-systemd-wrapper -f /etc/haproxy2.conf -p /var/run/haproxy2.pid
Update: This is what I get from service haproxy status:
[root@lb01 ~]# service haproxy status
Redirecting to /bin/systemctl status haproxy.service
haproxy.service - HAProxy Load Balancer
Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled)
Active: inactive (dead) since Fri 2015-10-30 16:35:44 GMT; 6s ago
Process: 3221 ExecStart=/usr/local/sbin/haproxy-systemd-wrapper -f /etc/haproxy.conf -p /var/run/haproxy.pid; /usr/local/sbin/haproxy-systemd-wrapper -f /etc/haproxy2.conf -p /var/run/haproxy2.pid (code=exited, status=0/SUCCESS)
Main PID: 3221 (code=exited, status=0/SUCCESS)
Oct 30 16:48:01 lb01 systemd: Started HAProxy Load Balancer.
Oct 30 16:48:01 lb01 haproxy-systemd-wrapper: Usage : haproxy [-f <cfgfile>]* [ -vdVD ] [ -n <maxconn> ] [ -N <maxpconn> ]
Oct 30 16:48:01 lb01 haproxy-systemd-wrapper: [ -p <pidfile> ] [ -m <max megs> ] [ -C <dir> ]
Looks like haproxy is maybe reading in the semicolon and the extra command as parameters?