We see the same issue on Debian11, python3.9. /bin/sh is pointing to /bin/dash, where the module system (lmod in our case) is not supported, and "module load .." fails.
It would be great if you could recommend a solution to that issue, without changing #!/bin/sh do bash for the reasons explained here:
Shell - Debian Wiki
"Debian uses
Dash as the default non-interactive shell. It is not intended to be used interactively by a user, for example, in a terminal emulator, but rather focuses on speed and compatibility with standards. Therefore, many interactive features are not present in
Dash, making it faster and more memory efficient than
Bash." For this reason, we do not want to change the system-wide "non-interactive shell" from dash to bash.
Compilation of CESM 2.2.0 works fine. the Problem occurs only when preparing the submit script to slurm. We have adapted the lines in config_machines.xml to :
<init_path lang="tcsh">/mnt/nfs/clustersw/Debian/bullseye/lmod/lmod/init/tcsh</init_path>
<init_path lang="bash">/mnt/nfs/clustersw/Debian/bullseye/lmod/lmod/init/bash</init_path>
<cmd_path lang="tcsh">/mnt/nfs/clustersw/Debian/bullseye/lmod/lmod/libexec/lmod module</cmd_path>
<cmd_path lang="bash">/mnt/nfs/clustersw/Debian/bullseye/lmod/lmod/libexec/lmod module</cmd_path>
but it still does not work . If anyone has an idea what might work, please let us know.
The problem is probably im
<init_path lang="sh">/mnt/nfs/clustersw/Debian/bullseye/lmod/lmod/init/bash</init_path>
which will start dash, and then try to run some lmod commands, which fails than in dash.
when trying to run
grep -r '/bin/sh' --exclude-dir '.git' ~/CESM220
we see 144 entries. Any idees which one need to be change ? Would you recommand to change all of them to /bin/bash ?