Hello,

I'm trying to use the "--" option for load multiple files in a systemd
unit, using the following file:



[Unit]
Description=HAProxy Load Balancer
After=network.target

[Service]
ExecStartPre=/usr/local/sbin/haproxy -c -q -- /etc/haproxy/*
ExecStart=/usr/local/sbin/haproxy-systemd-wrapper -p /run/haproxy.pid
-- /etc/haproxy/*
ExecReload=/bin/kill -USR2 $MAINPID
KillMode=mixed
Restart=always

[Install]
WantedBy=multi-user.target



If I run "systemctl start haproxy.service" and "systemctl status
haproxy.service" the ExecStartPre report a Failue with "1".

But running the same command manually report "0"



/usr/local/sbin/haproxy -c -q -- /etc/haproxy/*
echo $?
0



Apart from this problem, the following is that the wrapper adds the
"-Ds" parameter at the end, and the previous "--" catch it as an other
argument, resulting in:



/usr/local/sbin/haproxy-systemd-wrapper -p /run/haproxy.pid
-- /etc/haproxy/*
<7>haproxy-systemd-wrapper: executing /usr/local/sbin/haproxy
-p /run/haproxy.pid -- /etc/haproxy/haproxy.conf -Ds 
[ALERT] 327/123043 (29118) : Could not open configuration file -Ds : No
such file or directory
<5>haproxy-systemd-wrapper: exit, haproxy RC=256



How is possible to define correctly a path with the configuration files
inside a systemd unit?



Thanks,


Reply via email to