Fail only if modulecmd is not in the installation tree and not on the PATH.
Motivation
In RHEL9, modulecmd is not contained within the installation tree at MODULESHOME/bin/modulecmd, but is on the PATH at /usr/bin/modulecmd.
It seems wrong to moduleInit(modulesHome='/usr' when MODULESHOME=/usr/share/modules, even though this works.
Solution
One possible solution is to test for modulecomd in the env if it is not found at MODULESHOME/bin/modulecmd.
Foreseen Consequences
Possible issues where the modulecmd binary and installation mismatch, when multiple installations of Environment Modules exist on the same system, depending on how PATH is managed.
Fail only if
modulecmd
is not in the installation tree and not on thePATH
.Motivation
In RHEL9,
modulecmd
is not contained within the installation tree atMODULESHOME/bin/modulecmd
, but is on thePATH
at/usr/bin/modulecmd
.It seems wrong to
moduleInit(modulesHome='/usr'
whenMODULESHOME=/usr/share/modules
, even though this works.Solution
One possible solution is to test for
modulecomd
in the env if it is not found atMODULESHOME/bin/modulecmd
.Foreseen Consequences
Possible issues where the
modulecmd
binary and installation mismatch, when multiple installations of Environment Modules exist on the same system, depending on howPATH
is managed.