add support for --allow-use-as-root-and-accept-consequences - #2123
Conversation
|
@rjeschmi please review? |
| """Test --allow-use-as-root""" | ||
|
|
||
| # pretend we're running as root by monkey patching os.getuid used in main | ||
| easybuild.main.os.getuid = lambda: 0 |
There was a problem hiding this comment.
some linting tools don't like it when you assign lambda's, but this one is so trivial it doesn't require a def imho.
|
lgtm |
|
@JensTimmerman Any concerns about running everything as root vs only the steps that would really require root access (cfr. your comments in #420)? The latter would be a lot more difficult, and may not be worth the effort, since it wouldn't provide much protection against nasty things from happening during |
|
I think this is fine in general. I think another useful option is to demote from root to a particular user. I have a wrapper that does that for me so I can run easybuild as root more easily. |
|
@boegel I would add -i-know-this-is-a-bad-idea to the end of the option to make it clear this is an option that actually isn't supposed to be used. |
|
hahahaha +1 for @JensTimmerman suggestion ;) |
|
@JensTimmerman That's what the warning is for. Making the option annoyingly long/silly is something we can do, but it won't make any difference if you set it via the environment or in a configuration file (which makes it do once and forget). |
|
@boegel sure you can once and forget, but the point is that a new user can immediately identify this option as something that shouldn't be just be used lightheartedly. |
|
OK, fair point @JensTimmerman... So, pick one:
|
|
;) |
|
first one |
|
We briefly discussed this during today's EasyBuild conf call, where @pescobar mentioned that there may actually be good reasons to install something with root privileges, e.g. installing Singularity with EasyBuild (which requires enabling It would be nicer to have support to only leverage admin privileges when really needed, i.e. only when actually enabled There also seemed to be a consensus that The idea is to include this support for |
cfr. #420