[systemd-devel] Query regarding "EnvironmentFile"

Jóhann B. Guðmundsson johannbg at gmail.com
Mon Dec 21 05:23:29 PST 2015



On 12/21/2015 01:00 PM, Reindl Harald wrote:
>
>
> Am 21.12.2015 um 12:40 schrieb Jóhann B. Guðmundsson:
>>> 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.
>>>
>>> Then distros like Fedora could do a one-time migration of their
>>> settings in /etc/sysconfig/foobar and drop the file after the upgrade.
>>
>> This makes no sense.
>
> for you!

What he proposed is redundant and adds an extra line to the unit file 
and in addition requires some distro's acceptance that upstream needs to 
be aware of when it creates the unit for it's daemon/service.

His proposal

[Unit]
Description=Sample unit
# Unesseray line added
Environment=OPTS=FOO

[Service]
ExecStart=/path/to/daemon $OPTS

[Install]
WantedBy=multi-user.target

VS standard without any environment entry and does not require upstream 
being aware of any standardization or lack there of in downstream 
distributions.

[Unit]
Description=Sample unit

[Service]
ExecStart=/path/to/daemon FOO

[Install]
WantedBy=multi-user.target

By all means enlighten me the benefits of his proposal which makes sense 
and does not add unnecessary line to the type unit file along with the 
complexity it might bring ( think larger type units ).

JBG


More information about the systemd-devel mailing list