Tim, On Mon, May 06, 2019 at 01:00:51PM +0200, Tim Duesterhus wrote: > > Regarding the overriding of ExecStart, I disagree. In my opinion this is a > > confusing solution for the user, when doing that the user won't have the > > update > > of the unit file in the package. Lots of people still prefer /etc/default/ > > and > > /etc/sysconfig/ to add some options. > > I'm not sure whether I understand what you mean by "won't have the update". > With systemd it's fairly easy to just override the ExecStart= with a drop-in > file. Anything else is not modified. As an example: On my server I use this to > disable the PID file, because I think it's useless with systemd. > > # /lib/systemd/system/haproxy.service.d/no-pidfile.conf > [Service] > ExecStart= > ExecStart=/usr/sbin/haproxy -Ws -f $CONFIG >
I was talking about the distribution pushing an update to the unit file. For example if they want to add an option to the command line. In this particular case, as you override the ExecStart, you won't benefit from the new options on the ExecStart line in the new systemd unit. > > In this case we could indeed use the EXTRAOPTS variable, and add > > "EXTRAOPTS=-S /run/haproxy-master.sock" at the end of the Environment line. > > Okay, I've taken the patch from the Debian project and added Apollon (the > author) > and Vincent (the Debian developer I most frequently see on the list) to the > Cc. > Please object if you are unhappy with the changes as they are! > > MINOR: systemd: Use the variables from /etc/default/haproxy > The EXTRAOPTS part seems relevant, however the EnvironmentFile line is specific to each distribution, but they could still patch it in the other distributions. In my opinion this file is more like an example and it must be adapted to each distribution. -- William Lallemand

