[systemd-devel] Query regarding "EnvironmentFile"

Lennart Poettering lennart at poettering.net
Tue Dec 22 16:32:46 PST 2015


On Fri, 18.12.15 17:00, Michael Biebl (mbiebl at gmail.com) wrote:

> I do think that overriding the complete ExecStart= line is usually
> suboptimal and not what you want if you just want to pass additional
> options to the daemon.
> 
> Maybe a good middle ground / recommendation for such daemons would be,
> to ship a line
> 
> ExecStart=/usr/sbin/foobard $OPTS
> 
> and then tell admin to use systemctl edit
> [Unit]
> Environment=OPTS=-baz
> 
> bonus points if we could standardise the $OPTS var name across
> daemons.

Well, I think the time would be better spent on fixing the daemons to
put their configuration in native config files, so that the process
command line becomes irrelevant.

In the httpd case, I figure it would make sense if Fedora would just
ship a httpd at .service template whose instance name is used on a "-D"
switch or so... Multi-instantiable services are certainly a good idea
in many cases, in particular for web servers...

You know, I am fully aware that there will always be cases where
specific users want to change the cmdline of some random daemon. I
think the goal should be though that that's not the default case, but
very much the exception, and an exception where patching the command
line in the unit file is then fine. But introducing this $OPTS stuff
puts something in the focus of configuration that really shouldn't
be. If you regularly change the command line of a daemon on your
setups, then that's an indication that the daemon is misuing the
command line and should get better configuraiton files. And if you
only do it in exceptional cases, then editing the ExecStart= line is
completely fine and needs no concept of redirection.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list