[systemd-devel] EnvironmentFile, (-)sign

Lennart Poettering lennart at poettering.net
Thu Feb 28 10:00:42 PST 2013

On Thu, 28.02.13 17:05, lux-integ (lux-integ at btconnect.com) wrote:

> I am new to systemd.  I notice in the service files the  'EnvironmentFile' 
> path variable is prepended by a minus (-) sign like so:-
> EnvironmentFile=-/etc/sysconfig/whatever
> Could somene advise if this is necessary/advisable/advantageous  ...
> or not

See the discussion of EnvironmentFile= in systemd.exec(5).

If the file might not exist use "-", otherwise don't use it. 

Sometimes you want to make things robust to configuration fuckups, and
sometimes you want things to fail on configuration
fuckups. EnvironmentFile= gives you the choice which way you want to go,
dependening on your needs, just by using "-" or not.

It's a philosophical question, and some people and some usecases prefer
one, and others, the other.


Lennart Poettering - Red Hat, Inc.

More information about the systemd-devel mailing list