Where to set LEIN_ROOT?

1.3k Views Asked by At

When using sudo lein run (because some of the files changed by that command need priveleges) I get this message:

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.

Any idea how or where to set LEIN_ROOT in order to avoid getting this message?

1

There are 1 best solutions below

0
On BEST ANSWER

Add LEIN_ROOT=true to the end of /etc/profile. For this change to take effect, enter source /etc/profile to a terminal. Then run the command with sudo -E lein run to preserve environment variables. If you are doing this over ssh you would need to do all of the above on the server then add source /etc/profile to the start of the ssh command run on the local machine.

ssh [email protected] "source /etc/profile; sudo -E lein run"