User:Toshio/SystemdEnvFiles

EnvironmentFiles and support for /etc/sysconfig files
The  line in the   section of   files is used to support loading environment variables that can be used in unit files. For instance, if your sysv-initscript used a file in /etc/sysconfig to set command line options, you can use  like so:

Example: [Service] Type=forking EnvironmentFile=-/etc/sysconfig/httpd ExecStart=/usr/sbin/httpd $OPTIONS ExecReload=/usr/sbin/httpd $OPTIONS -k restart

You may then refer to variables set in the  file with and, in the lines (and related lines). ( expands the variable into one word,   splits up the variable value at whitespace into multiple words)

The "-" on the  line ensures that no error messages is generated if the environment file does not exist. Since many of these files were optional in sysvinit, you should include the "-" when using this directive.

Although environment files are easy to use, upstream systemd recommends a different approach. Their recommendation for administrators who need to reconfigure systemd  files is to copy them from   to   and modify them there. Unit files in  override those in   if they otherwise carry the same name.

Either approach is valid in Fedora.