NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a system environment variable at statup?

I need to create a system environment variable at startup (i.e. variable is created even if no one logs in). I tried to add,

FOO=bar

to /etc/environment. However, after rebooting this did not work.

 

Does anyone know how to do this with NI Linux Real-Time?

0 Kudos
Message 1 of 2
(1,885 Views)

While I was able to add 'FOO=bar' to /etc/environment and get it to persist after a reboot, I was unable to identify it as a system environment variable. 

 

Instead, I added 'export FOO=bar' to the end of /etc/profile. When I rebooted, this change persisted, and the variable was identified. This should apply system-wide.

Brian.D
NI Product Owner
VeriStand
Message 2 of 2
(1,851 Views)