Environment variables
Loading Environment variables
By default, Upswift agent runs as a systemd service. Therefore, all system Environment variables are not reachable by the agent and can't be used with Upswift tools (Micro-updates, Remote commands, etc..).
To make the Environment variables reachable by the agent, you can load a file that contains those variables to the agent's service configuration. When the file is loaded, you will be able to use your Environment variables in all Upswift tools. Follow the next steps to load your Environment variables to Upswift agent:
Create the file (if it doesn't exist)
/etc/environment
Set your Environment variables at the end of that file:
TEST_ENV="some-value"
Open the file
/etc/systemd/system/upswift.service
and right above the line that begins withExecStart
, enter the line:EnvironmentFile=/etc/environment
Save and close the file. Then execute the command:
systemctl daemon-reload
Then execute the command:
systemctl restart upswift
From now on, any Environment variable that will be written inside the file /etc/environment
, will be accessible from Upswift tools. (If you modify that file with new Environment variables or new values, you will have to restart Upswift service)
Last updated