[systemd-devel] Query regarding "EnvironmentFile"

Alex Crawford alex.crawford at coreos.com
Wed Dec 23 16:48:35 PST 2015


On 12/23, Jóhann B. Guðmundsson wrote:
> The usual underlying cause of usage of Environment or EnvironmentFile in 
> type units is more or less always due to the fact that the 
> daemon/service cannot read configuration file on startup thus the answer 
> is you would use a daemon that was written in a such manner it could 
> read configuration file, generate that file and get rid of the extra 
> administrator step of having administrators create and use drop-in's or 
> am I missing something?

We are effectively using the drop-in to allow the user to map command line
options to dynamic data. Since the user won't know things like IP addresses,
they cannot write a traditional configuration file:

 $ cat static.conf
 IP=1.2.3.4

They would instead have to write something like this:

 $ cat dynamic.conf
 IP=COREOS_PUBLIC_IPV4

Of course, the daemon would then need to understand how to follow this mapping
and do the substitution itself. We instead decided to piggy-back on systemd and
let it do the mapping for us.

-Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20151223/e3bca888/attachment-0001.sig>


More information about the systemd-devel mailing list