Skip to content

Allow a configurable list of initrc files #722

Open

Description

@xdelaruelle

The initrc configuration file is evaluated when the Modules environment is initialized (when both MODULEPATH and LOADEDMODULES are unset or empty). It defines the modulepaths to enable, the modules to load and the module configuration to apply at startup.

Today a single initrc file is supported and its location is fixed at build time: it lives in the directory set by the --etcdir configure option. There is no way to point to another initrc file or to add further ones once Modules is installed.

By contrast, the global run-command file benefits from the MODULERCFILE environment variable and the rcfile configuration option. Several files may be listed there, separated by a colon, and this list supersedes the built-in default. The site-specific configuration script also has a similar mechanism with MODULES_SITECONFIG, which designates an additional script to evaluate.

Users at the HPSF Conference 2026 asked for the same flexibility for initrc. The situations reported were:

  • Sites that deploy Modules from a distribution package or from a shared installation cannot change the built-in initrc location, yet need to provide their own initialization content.
  • Sites that organize the initialization in layers (a site-wide part, then a cluster-, team- or project-specific part) want to split it into several files evaluated in sequence rather than maintaining one large file or having one file source the others.

It should be possible to configure a list of initrc files, through an environment variable and a matching configuration option like MODULERCFILE/rcfile, with several files separated by a colon and evaluated in the order given.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions