Open akinomyoga opened 2 months ago
Maybe it's worth making environment variable overrides. Here's a snippet from Lmod
, and although not related to interactive shell, would be good reference:
if [ -z "${LMOD_ALLOW_ROOT_USE+x}" ]; then
LMOD_ALLOW_ROOT_USE=yes
fi
( [ -n "${USER_IS_ROOT:-}" ] || ( [ "${LMOD_ALLOW_ROOT_USE:-}" != yes ] && [ $(id -u) = 0 ] ) ) && return
Maybe it's worth making environment variable overrides. Here's a snippet from
Lmod
, and although not related to interactive shell, would be good reference:if [ -z "${LMOD_ALLOW_ROOT_USE+x}" ]; then LMOD_ALLOW_ROOT_USE=yes fi ( [ -n "${USER_IS_ROOT:-}" ] || ( [ "${LMOD_ALLOW_ROOT_USE:-}" != yes ] && [ $(id -u) = 0 ] ) ) && return
What's that? These lines seem to be set up by /etc/profiles.d/modules.sh
(i.e., the entry point of Lmod) and do not seem to be something each module should perform. Does Lmod instruct every module to include those lines? Also, I'm not sure if we should include such a setting specific to the specific framework in the upstream codebase. Shouldn't they be added by the Fedora packages?
/etc/profiles.d/modules.sh
is loaded only once in order to define the module
command. That section is a fallthrough to check if the file is sourced by the root
and if there are overrides. This file is defined in /usr/share/lmod/lmod/init/profile
and afaict, Lmod
controls and installs that file.
Shouldn't they be added by the Fedora packages?
Of course, that would also be possible, but maybe some standardization of override environment variables should be considered if that would be added.
From the discussion in #159: