Load Environment Variables

To make environment variables on your IoT device reachable by the JFrog Connect Agent, you can load a file to the agent’s service configuration. This page describes the procedure.

The JFrog Connect Agent runs as a systemd service. Therefore, system environment variables are not reachable by the agent and cannot be used with Connect tools such as Remote Commands.

To make the environment variables reachable by the Connect Agent, you can load a file containing the variables to the agent’s service configuration. Once the file is loaded, you can use environment variables in Connect tools.

To load your environment variables to the Connect Agent, do the following:

  1. Create the file: /etc/environment

  2. Place your environment variables at the end of the file. For example:

TEST_ENV="some-value"
NEW_PARAMETER="VALUE"  
  1. Open the file /etc/systemd/system/connect.service, and right above the line that begins with ExecStart, enter the line:

EnvironmentFile=/etc/environment
  1. Save and close the file. Execute the command:

systemctl daemon-reload
  1. Execute the command:

systemctl restart connect

Once you have completed the steps above, any environment variable written inside the file /etc/environment, will be accessible from Connect tools.

File Modifications

If you modify the file /etc/environment, you will need to restart the Connect service for the changes to take effect. This includes adding, deleting or changing variables, and changing any values of the variables.

Last updated