How to pass custom environment variable in systemd unit file ?
Issue
-
Unable to pass custom environment variable in systemd unit file definition.
Environment="VAR1=VALUE1" Environment="VAR2=$VAR1 VALUE2" -
The variable
$VAR1does not get resolved with correct value (VALUE1). -
Use of
EnvironmentFiledid not resolve the value of the environment variable$VAR1. -
How to source RC files for bash, csh or other shells in systemd unit file.
Environment
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Systemd
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.