The my-service that is running on the Linux machine needs to be supplied with the ENV_VAR environment variable. It works if I declare this variable in the etc/environment file with:
vim /etc/environment
then adding an extra line:
ENV_VAR="My Value"
And finally reloading it with:
source /etc/environment
I then can re-start the my-service with:
sudo service my-service stop
sudo service my-service start
I wonder if I could avoid declaring ENV_VAR variable in the etc/environment file. Is there a way to declare the environment variable to be seen by the service using any other approach?