在哪里设置LEIN_ROOT?

时间:2017-01-07 02:58:18

标签: environment-variables leiningen

使用sudo lein run时(因为该命令更改的某些文件需要priveleges),我收到此消息:

WARNING: You're currently running as root; probably by accident.
Press control-C to abort or Enter to continue as root.
Set LEIN_ROOT to disable this warning.

知道如何或在何处设置LEIN_ROOT以避免收到此消息?

1 个答案:

答案 0 :(得分:3)

LEIN_ROOT=true添加到/etc/profile的末尾。要使此更改生效,请在终端中输入source /etc/profile。然后使用sudo -E lein run运行命令以保留环境变量。 如果您通过ssh执行此操作,则需要在服务器上执行上述所有操作,然后将source /etc/profile添加到本地计算机上运行的ssh命令的开头。

ssh user@123.456.789 "source /etc/profile; sudo -E lein run"