Skip to content

Commit cd32959

Browse files
committed
doc: desc. __MODULES_AUTOINIT_INPROGRESS in man/changes
1 parent 6e53e78 commit cd32959

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

doc/source/changes.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,12 @@ initialization or if the :mconfig:`silent_shell_debug` configuration option is
586586
set to ``1`` in the :file:`initrc` configuration file. Option is set off by
587587
default on Modules 5.
588588

589+
During the :subcmd:`autoinit` process, the environment variable
590+
:envvar:`__MODULES_AUTOINIT_INPROGRESS` is checked and if it is found set to
591+
``1``, the initialization process immediately ends. If not, this environment
592+
variable is set to ``1`` which ensures no initialization loop could occur,
593+
especially when the :mconfig:`set_shell_startup` configuration option is set.
594+
589595
Modulecmd startup
590596
"""""""""""""""""
591597

@@ -779,7 +785,8 @@ The following environment variables appeared on Modules 5.
779785
| in version | |
780786
+============+=================================================================+
781787
| 5.0 | :envvar:`MODULES_QUARANTINE_SUPPORT`, |
782-
| | :envvar:`__MODULES_QUARANTINE_SET` |
788+
| | :envvar:`__MODULES_QUARANTINE_SET`, |
789+
| | :envvar:`__MODULES_AUTOINIT_INPROGRESS` |
783790
+------------+-----------------------------------------------------------------+
784791

785792
Modules Specific Tcl Commands

doc/source/module.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,6 +1815,19 @@ Otherwise ``1`` is returned.
18151815
ENVIRONMENT
18161816
-----------
18171817

1818+
.. envvar:: __MODULES_AUTOINIT_INPROGRESS
1819+
1820+
If set to ``1``, the :subcmd:`autoinit` sub-command process is skipped.
1821+
1822+
This environment variable is set to ``1`` by the :subcmd:`autoinit`
1823+
sub-command after checking it is not set. It ensures no nested initialization
1824+
of Modules occur. At the end of the processing of the :subcmd:`autoinit`
1825+
sub-command, :envvar:`__MODULES_AUTOINIT_INPROGRESS` is unset.
1826+
1827+
.. only:: html
1828+
1829+
.. versionadded:: 5.0
1830+
18181831
.. envvar:: __MODULES_LMALTNAME
18191832

18201833
A colon separated list of the alternative names set through

0 commit comments

Comments
 (0)