Lmod icon indicating copy to clipboard operation
Lmod copied to clipboard

What would happen if I changed this script?

Open simon-Leary42 opened this issue 2 years ago • 5 comments

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?

simon-Leary42 avatar Jul 19 '22 23:07 simon-Leary42

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.

simon-Leary42 avatar Jul 19 '22 23:07 simon-Leary42

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.

rtmclay avatar Jul 20 '22 13:07 rtmclay

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!

kcgthb avatar Jul 27 '22 22:07 kcgthb

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

boegel avatar Aug 08 '22 13:08 boegel

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.

kcgthb avatar Aug 08 '22 15:08 kcgthb

I have integrated both changes into update_lmod_system_cache.in. If you get a change to test Lmod 8.7.12.

rtmclay avatar Aug 18 '22 20:08 rtmclay

I am closing this issue. If there is a problem feel free to reopen.

rtmclay avatar Aug 25 '22 19:08 rtmclay