In a case a modulefile executes a bash shell script to fetch a value:
$ cat foo
#%Module
exec ./bar
$ cat bar
#!/bin/bash
echo bar
If this modulefile is loaded and set_shell_startup option is enabled, any autoinit call ends in an infinite loop:
$ ps --no-headers -C tclsh | wc -l
0
$ $MODULES_CMD bash autoinit &
[1] 129648
$ ps --no-headers -C tclsh | wc -l
151
$ ps --no-headers -C tclsh | wc -l
284
$ ps --no-headers -C tclsh | wc -l
391
It appears that the bar bash script triggers an autoinit evaluation due to the set_shell_startup mechanism, and this autoinit refreshes currently loaded modules which makes the foo modulefile re-executes the bar bash script which triggers again the autoinit evaluation and so on.
In a case a modulefile executes a bash shell script to fetch a value:
If this modulefile is loaded and
set_shell_startupoption is enabled, anyautoinitcall ends in an infinite loop:It appears that the
barbash script triggers an autoinit evaluation due to theset_shell_startupmechanism, and this autoinit refreshes currently loaded modules which makes thefoomodulefile re-executes thebarbash script which triggers again the autoinit evaluation and so on.