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

autoinit loops when set_shell_startup is enabled #414

Closed
xdelaruelle opened this issue Sep 26, 2021 · 0 comments
Closed

autoinit loops when set_shell_startup is enabled #414

xdelaruelle opened this issue Sep 26, 2021 · 0 comments
Labels
Milestone

Comments

@xdelaruelle
Copy link
Collaborator

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.

@xdelaruelle xdelaruelle changed the title autoinit loop when set_shell_startup is enabled autoinit loops when set_shell_startup is enabled Sep 26, 2021
@xdelaruelle xdelaruelle added this to the 5.0.1 milestone Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant