What is the right way to set PATH variable in a systemd
unit file?
After seeing a few examples, I tried to use the format below, but the variable doesn't seem to expand.
Environment="PATH=/local/bin:$PATH"
I am trying this on CoreOS with the below version of systemd.
systemd 225
-PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT -GNUTLS -ACL +XZ -LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD -IDN
/bin
, and that defeats the purpose of setting my custom PATH. That is, if I addEnvironment="PATH=foo:bar"
I end up gettingPATH=/bin:foo:bar
for my service. – Carmoncarmona