@SeglerEDCE:
Es ist schlimmer als gedacht!
<https://lmod.readthedocs.io/en/latest/030_installing.html#bash>
Und, obendrauf – „PROFILEREAD” → ‚/etc/profile’ – ab Zeilennummer 291 –
#
# Source profile.d files and UTF8 settings
#
# But do not source this if PROFILEREAD is already set to avoid
# overriding locale variables already present in the environment
#
if test -z "$PROFILEREAD" ; then
test -r /etc/profile.d/sh.ssh && . /etc/profile.d/sh.ssh
fi
#
# Source profile extensions for certain packages, the super
# may disable some of them by setting the sticky bit.
#
if test -d /etc/profile.d -a -z "$PROFILEREAD" ; then
for s in /etc/profile.d/*.sh ; do
test -r $s -a ! -k $s && . $s
done
unset s
fi
Also, beim einloggen, egal wie, ‚/etc/profile’ wird aufgerufen und, beim erste Lauf, „PROFILEREAD” wird gesetzt –
> echo $PROFILEREAD
true
>
‚/etc/profile’ – ab Zeilennummer 320 –
#
# Avoid overwriting user settings if called twice
#
if test -z "$PROFILEREAD" ; then
readonly PROFILEREAD=true
export PROFILEREAD
fi
Und, das „PROFILEREAD” Wert kann nicht geändert werden –
> help readonly
readonly: readonly [-aAf] [Name[=Wert] ...] oder readonly -p
Mark shell variables as unchangeable.
Mark each NAME as read-only; the values of these NAMEs may not be
changed by subsequent assignment. If VALUE is supplied, assign VALUE
before marking as read-only.
.
.
>
Auch hier – <https://github.com/TACC/Lmod/issues/492>
Und, die Lmod Umgebungsvariablen sind gesetzt worden –
> set | grep -i 'lmod'
BASH_ENV=/usr/share/lmod/8.7.17/init/bash
LMOD_CMD=/usr/share/lmod/lmod/libexec/lmod
LMOD_COLORIZE=no
LMOD_DIR=/usr/share/lmod/lmod/libexec
LMOD_FULL_SETTARG_SUPPORT=no
LMOD_PKG=/usr/share/lmod/lmod
LMOD_PREPEND_BLOCK=normal
LMOD_ROOT=/usr/share/lmod
LMOD_SETTARG_CMD=:
LMOD_SETTARG_FULL_SUPPORT=no
LMOD_VERSION=8.7.17
MODULEPATH=/usr/share/lmod/modulefiles
MODULESHOME=/usr/share/lmod/lmod
__LMOD_REF_COUNT_MODULEPATH=/usr/share/lmod/modulefiles:1
> which -a lmod
which: no lmod in (/home/xx/bin:/usr/local/bin:/usr/bin:/bin)
>
> echo $BASH_ENV
/usr/share/lmod/8.7.17/init/bash
>
Also, was ist passiert?
-
Bei einloggen, die Skripten in ‚/etc/profile.d/’ sind aufgerufen worden und, die Kommandos „module” und „ml” sind definiert worden …
-
Aber, nicht bei das Systemprozess wo das Eingabeaufforderung auftaucht …
Lösung:
- Jeder Benutzer der Lmod benutzen will, muss die Shell-Skripten in ‚/etc/profile.d/’ vom seine „bashrc” Datei (nochmals) aufrufen …