Description of problem: "systemctl show" doesn't show environment variables defined when EnvironmentFile is used Version-Release number of selected component (if applicable): systemctl --version systemd 216 +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN How reproducible: Always Steps to Reproduce: 1.Using a services file with EnvironmentFile=/path/to/environment 2.start service 3.run "systemctl show" on that service Actual results: Environment=[empty] Expected results: Environment=VAR=val VAR2=val, etc. Additional info:
Yes, Environment only refers to the configuration directive. Variables set in EnvironmentFile are separate. A different question is whether systemd should show variables defined in EnvironmentFile Systemd does not show those because EnvironmentFile is actually read late — just before the process is executed. Variable substitution is actually done after a fork and the main systemd process cannot display them, because it does not know their values for some variables. So this is by design, and hard to change. As a partial workaround you can do something like tr '\0' '\n' < /proc/<pid-of-daemon>/environ This will show the environment of the process.