Bug: 'modulespath' error at logon when using jailshell
Environment: Alma Linux 8.5.latest, cPanel 94.0.23 LTS
Jailshell users get a minor error when logging into command line (ie using 'Terminal' or via SSH):
The error is coming from this section of /etc/profile.d/scl-init.sh:
The sed line is called because MODULEPATH is unset at runtime, and fails because /usr/share/Modules/init/.modulespath does, in fact, not exist. After logon, a jailshell user ends up with this in their environment:
When using the 'normal' shell (ie bash), MODULEPATH is set at runtime and thus that section is skipped and the error does not occur. In this case, they end up with this instead in their environment:
I did some digging to try to find out where the difference lies but was unable to locate it. I'm guessing maybe some logon piece is missing somewhere from the jail environment, but the difference might lie in the jailshell binary itself. As far as I've seen this doesn't seem to have any impact on normal use. I have had users ask about it though. Thanks!
sed: can't read /usr/share/Modules/init/.modulespath: No such file or directoryThe error is coming from this section of /etc/profile.d/scl-init.sh:
if [ "${MODULEPATH:-}" = "" ]; then
MODULEPATH=`sed -n 's/[ #].*$//; /./H; $ { x; s/^\n//; s/\n/:/g; p; }' ${MODULESHOME}/init/.modulespath`
fi
The sed line is called because MODULEPATH is unset at runtime, and fails because /usr/share/Modules/init/.modulespath does, in fact, not exist. After logon, a jailshell user ends up with this in their environment:
MODULEPATH=/etc/scl/modulefiles:When using the 'normal' shell (ie bash), MODULEPATH is set at runtime and thus that section is skipped and the error does not occur. In this case, they end up with this instead in their environment:
MODULEPATH=/etc/scl/modulefiles:/usr/share/Modules/modulefiles:/etc/modulefiles:/usr/share/modulefilesI did some digging to try to find out where the difference lies but was unable to locate it. I'm guessing maybe some logon piece is missing somewhere from the jail environment, but the difference might lie in the jailshell binary itself. As far as I've seen this doesn't seem to have any impact on normal use. I have had users ask about it though. Thanks!
-
Hey there! This is a known issue and was fixed in cPanel 98. At this time the team is not planning to backport this change to version 94, but if you update to a new tier, or wait for the next LTS, you'll see it's working normally. 0 -
Ok, good to know! I had searched around the forums, KB, and changelogs and couldn't find a mention of it anywhere but maybe I missed it. :confused: 0 -
The case was CPANEL-36907 and I don't see it in the change logs but can confirm it was tested in the 96/98 branches when the work was completed. 0
Please sign in to leave a comment.
Comments
3 comments