-
Notifications
You must be signed in to change notification settings - Fork 117
Closed
Description
In a case a modulefile executes a bash shell script to fetch a value:
$ cat foo
#%Module
exec ./bar
$ cat bar
#!/bin/bash
echo barIf 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
391It 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.