Bug 2123487 - Warning message in login if MODULEPATH environment variable is not set
Summary: Warning message in login if MODULEPATH environment variable is not set
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: scl-utils
Version: 8.6
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: Lukáš Zachar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-01 19:26 UTC by Paulo Andrade
Modified: 2023-07-31 07:47 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-133061 0 None None None 2022-09-01 19:50:47 UTC

Description Paulo Andrade 2022-09-01 19:26:05 UTC
This might happen if for some reason the link /etc/profile.d/modules.sh
is missing or some other problem with alternatives.

/etc/profile.d/scl-init.sh has:

if [ "${MODULEPATH:-}" = "" ]; then
   MODULEPATH=`sed -n 's/[   #].*$//; /./H; $ { x; s/^\n//; s/\n/:/g; p; }' ${MODULESHOME}/init/.modulespath`
fi

but there is no /usr/share/Modules/.modulespath file, that should be now
legacy.

Maybe /etc/profile.d/scl-init.sh should check if that file exist before the
sed command, or, maybe better print a warning telling MODULEPATH is not
defined.

In either case, this is a way to detect problems with alternatives and
missing environment-modules initialization.

This should be a minimal issue, just that some message should still be
printed, but better if not a sed error message about a missing file, like:

sed: can't read /usr/share/Modules/init/.modulespath: No such file or directory

for every shell login.


Note You need to log in before you can comment on or make changes to this bug.