[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: systemd service and /etc/default/



On 17/08/14 10:38, Thomas Goirand wrote:
> I had the same problem as you describe above, even a bit more
> complicated because, in what we did, /etc/default/<file> sometimes
> doesn't exist (it's not mandatory in what we did).

EnvironmentFile takes precedence over Environment, and EnvironmentFile
starting with - means "do not fail if it is missing" (syntax inspired by
"-include more-rules.mk" in GNU make, I think), so you can do something
like:

Environment=FOO_VERBOSE=-v
# yes this is really the syntax if it contains spaces, see the man page
Environment="FOO_PLUGINS=foo bar misc other"
# override FOO_VERBOSE, FOO_PLUGINS if present
EnvironmentFile=-/etc/default/foo
Exec=/usr/lib/foo/foo-daemon $FOO_VERBOSE

Regards,
    S


Reply to: