TACC / Lmod

Lmod: An Environment Module System based on Lua, Reads TCL Modules, Supports a Software Hierarchy
http://lmod.readthedocs.org
Other
492 stars 128 forks source link

Enforce a "system" module for all lmod users #700

Closed nortex closed 7 months ago

nortex commented 7 months ago

Hi all,

Is there an option in LMOD to define a system module or set of modules to be applied for all users without them knowing about it?

Like a hidden module that is always loaded even if user run module purge?

wpoely86 commented 7 months ago

What you describe sounds more like a script for a /etc/profile.d directory than a module :wink:

A hidden module is hidden for avail or spider but not when it's loaded. It just gets marked with an H. If you make the module sticky, it will remain loaded on a purge. You need a ml --force purge to really purge it.

rtmclay commented 7 months ago

I completely agree with @wpoely86. The whole point of modules is to allow the user to control their environment. This means unloading any module they want.

nortex commented 7 months ago

Thanks for the answers. The "sticky" module function seems to be the one I need. The auto-load could definitely be set in /etc/profile.d

I need the "enforcement" of the module in order to set important stdenv variables for dynamic MODULEPATH and other software stack related variables. So I need to make sure user gets this module loaded.

simonLeary42 commented 6 months ago

I was writing /etc/profile.d scripts and found myself writing the same logic repeatedly in bash/zsh/tcsh, and I thought that it would be nice to write it just once and let Lmod abstract away the shell syntax for me. I think with some hacky environment variable modification you could load a module and then trick Lmod into thinking that nothing has been loaded.

rtmclay commented 6 months ago

As described above, you can get most of what you want by using a sticky module. But "module list" will list this sticky module.