How to set and declare a variable through systemctl?

博客围绕在Red Hat Enterprise Linux 7环境下,如何通过systemctl设置和声明变量展开。提出已用命令设置环境变量,询问systemctl设置方法,给出使用特定命令声明和设置变量的决议,还可将命令添加到文件实现每次重启执行,另有方法可参考上游文档链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值