Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lmod issues with openSuse Leap #2069

Open
jackOrion19 opened this issue Jan 30, 2025 · 3 comments · May be fixed by #2071
Open

Lmod issues with openSuse Leap #2069

jackOrion19 opened this issue Jan 30, 2025 · 3 comments · May be fixed by #2071
Labels
Milestone

Comments

@jackOrion19
Copy link

I have a somewhat similar issue to #1974, where less used on any file prints this message:

/opt/ohpc/admin/lmod/lmod/init/bash: /opt/ohpc/admin/lmod/lmod/libexec/addto : /usr/bin/lua5.3 : bad interpreter: Permission denied

I have tracked down the problem to the line:

export FPATH=$(/opt/ohpc/admin/lmod/lmod/libexec/addto --append FPATH ${__zsh_fpath:-$FPATH} /opt/ohpc/admin/lmod/lmod/init/ksh_funcs)

in /opt/ohpc/admin/lmod/8.7.53/init/bash (when commenting this line the message doesn't appear anymore).

Running this line in bash directly works normally.

I confirmed that this is an AppArmor problem by looking at the logs in /var/log/audit/audit.log:

type=AVC msg=audit(1738240871.101:5569): apparmor="DENIED" operation="exec" class="file" profile="/usr/bin/lessopen.sh" name="/opt/ohpc/admin/lmod/8.7.53/libexec/addto" pid=14071 comm="lessopen.sh" requested_mask="x" denied_mask="x" fsuid=0 ouid=0

I have tried to add /usr/bin/lua5.3 to /etc/apparmor.d/usr.bin.lessopen.sh, to try the solution proposed in #1974, but that didn't solve the problem.

I have reproduced the issue on fresh installs of both openSuse Leap 15.5 and 15.6, after setting up OpenHPC repository and installing only ohpc-base.

I noticed that package lua-lmod provided in the openSuse repository doesn't have this problem, and seems to enclose the export FPATH... part with:

SUPPORT_KSH="no"
if [ $SUPPORT_KSH = yes -o -n "${KSH_VERSION+x}" ]; then
   if [ -z "${__LMOD_SET_FPATH+x}" ]; then
      export FPATH=$(/usr/share/lmod/lmod/libexec/addto --append FPATH  /usr/share/lmod/lmod/init/ksh_funcs)
      export __LMOD_SET_FPATH=1
   fi
fi
unset SUPPORT_KSH
@adrianreber
Copy link
Member

Thanks for the report. Have you tried the openSuse change with the OpenHPC package?

@mslacken is this something you have dealt with before? Any recommendations?

@adrianreber adrianreber added this to the 3.3 milestone Feb 4, 2025
@adrianreber adrianreber added the bug label Feb 4, 2025
@mslacken
Copy link
Contributor

mslacken commented Feb 4, 2025

Sorry for the late reply, I wanted to deal with this, but forgot it.
The problem here is not FPATH, but the missing configuration files for apparmor. Due to a suboptimal layout of the apparmor package in openSUSE, we can't add this configuration itself (the apparmor package doesn't create the /etc/apparmor.d/abstractions/bash.d drop in directory).
If you want to use apparmor and OHPC you will have to create the file
/etc/apparmor.d/abstractions/bash.d/lmod
with the following content

   abi <abi/3.0>,

   /opt/ohpc/admin/lmod/8.7.53/init/*    r,
   /opt/ohpc/admin/lmod/8.7.53/libexec/addto ix,

I will create a PR for this.
@e4t created this for openSUSE packages.

P.S.

apparmor will go away in the upcoming releases, openSUSE tumbleweed already switched to selinux.

@mslacken mslacken linked a pull request Feb 4, 2025 that will close this issue
@jackOrion19
Copy link
Author

Thanks for the answer @mslacken , it works with the Apparmor file you provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants