Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-6300

Warning message in login if MODULEPATH environment variable is not set

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • rhel-8.6.0
    • scl-utils
    • Normal
    • sst_cs_software_management
    • ssg_core_services
    • False
    • Hide

      None

      Show
      None
    • No
    • Release Note Not Required

      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.

            packaging-team-maint packaging-team-maint
            rhn-support-pandrade Paulo Andrade
            packaging-team-maint packaging-team-maint
            Lukas Zachar Lukas Zachar
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: