https://access.redhat.com/solutions/1581063

 SOLUTION UNVERIFIED - 已更新 2015年八月18日15:11 - 

English 

环境

  • Red Hat Enterprise Linux 7

问题

  • Have set the environment variable using systemd commands.
  • How to set and declare a variable through systemctl?

决议

  • Use the following command to declare and set a variable.

Raw

# systemctl set-environment VARIABLE=1000
  • Add that command in /etc/profile file to get executed at every reboot in case it's wanted for all time.
  • There is another way to achieve this, it's explained in the following link of upstream documentation.