Lmod
Lmod copied to clipboard
What would happen if I changed this script?
https://github.com/TACC/Lmod/blob/a360fcac3c97cd2172eb6976a8b1e5a570d469fc/src/update_lmod_system_cache_files.in#L258
I want to switch from cp -p
to cp
. Are there implications to this that I don't see?
The reason I want to change it is because only root is allowed to execute update_lmod_system_cache_files
. I want to let a group on my system execute this script, but no amount of ACL's will make it work, only the unix-style owner can cp -p
a file.
None that I can see. Please test it out to see. I'll think about this. This issue will be discussed at the next Lmod Zoom Mtg.
Excellent timing! I was just about to open an issue for the exact same thing: we're starting to have multiple people needing to update the spider cache, and that cp -p
command is not compatible with that setup, indeed. So I'd be in favor of dropping it too.
I also noted that the following mv
command https://github.com/TACC/Lmod/blob/a360fcac3c97cd2172eb6976a8b1e5a570d469fc/src/update_lmod_system_cache_files.in#L264
could also lead to issues when a user is trying to overwrite cache files created by another user:
/usr/bin/mv: try to overwrite ‘/share/software/modules/.cache/spiderT.lua’, overriding mode 0644 (rw-r--r--)?
So maybe using mv -f
would help there too?
Thanks!
I think the original intention of using cp -p
was to preserve metadata on the file, but I don't see a strict need for it either.
Not sure about the mv
, but if it doesn't have any obvious negative impact, I guess that can be changed too to mv -f
We've been running with those two local modifications for a couple weeks now, and as far as I can tell, things are working great. We can have multiple sysadmins update the shared spider cache without generating permission issues, so it looks good from our perspective.
I have integrated both changes into update_lmod_system_cache.in. If you get a change to test Lmod 8.7.12.
I am closing this issue. If there is a problem feel free to reopen.