Skip to main content

Environment Variables

  • April 16, 2015
  • 5 replies
  • 0 views

I'm looking for the setting of environment variables in an Enterprise Server in stopped status.  (path)  Any tips ?


#EnterpriseServer

5 replies

  • Author
  • Rocketeer
  • 19312 replies
  • April 16, 2015

I'm looking for the setting of environment variables in an Enterprise Server in stopped status.  (path)  Any tips ?


#EnterpriseServer

Do you mean what the server's PATH environment variable will be when it's started?

That depends on various factors.

  • If the server's configuration text area, on the initial tab of the server settings in the MFDS (Enterprise Server Administration) GUI, has an [ES-Environment] section, and that section has a setting for PATH, then when the region is started, one of the top-level CAS processes will set that value for the path in the environment for its child processes. Values here can include environment-variable expansions, and often if people set PATH in [ES-Environment] they include its old value (e.g. PATH=/some/dir:$PATH), so the other items in this list may still apply.
  • If you're starting the server using the MFDS GUI (rather than the casstart command-line utility), and a startup script is configured for the server under the Scripts tab, then the script may alter the environment before running casstart.
  • If you're starting the server using the MFDS GUI, then it will inherit its environment (before possibly changing it in either or both of the two ways I just described) from the MFDS process.
    • If MFDS was started from the command line, it inherits its environment from whatever shell session it was started from. On UNIX, a trigger script or program may have modified the environment before running the actual MFDS executable (mfds32).
    • On Windows, if MFDS is running as a service, it will inherit the system environment, as defined in the Registry.
    • On UNIX, if MFDS was started from inittab, an rc script, or similar, then its environment is probably similar to the contents of /etc/environment, but this can be customized in many ways so it's impossible to predict exactly what you might get on a given system.
  • If the server is started by running casstart from the command line, it will inherit its environment from the shell in which casstart was run.

My recommendations are, first, to avoid environment dependencies whenever possible. The environment is a terrible way to configure a non-interactive process. And second, if your server does depend on anything in the environment, use the [ES-Environment] section (or, if necessary, a startup script) to ensure it's set appropriately.


  • Author
  • Rocketeer
  • 19312 replies
  • April 16, 2015

I'm looking for the setting of environment variables in an Enterprise Server in stopped status.  (path)  Any tips ?


#EnterpriseServer

Hi, when ES starts it writes a file in the es directory (/var/mfcobol/es/ESSERVER/ ) were the env variables are stored. The filename is ESSERVER.env. The variables are spitted by x'00'

Are you searching for that file? It shows you the env var setting of the ES from the last start.


  • Author
  • Rocketeer
  • 19312 replies
  • April 16, 2015

I'm looking for the setting of environment variables in an Enterprise Server in stopped status.  (path)  Any tips ?


#EnterpriseServer

Hi, when ES starts it writes a file in the es directory (/var/mfcobol/es/ESSERVER/ ) were the env variables are stored. The filename is ESSERVER.env. The variables are spitted by x'00'

Are you searching for that file? It shows you the env var setting of the ES from the last start.


  • Author
  • Rocketeer
  • 19312 replies
  • April 16, 2015

I'm looking for the setting of environment variables in an Enterprise Server in stopped status.  (path)  Any tips ?


#EnterpriseServer

Hi,

of course the ESSERVER.env File shows you only the values set in the browser interface. If you want all env. variables you have to check the profile of the tech. user, global profiles, your startup script,... this would be very difficult. One thing you can do is that you a line in your script, which writes your env. to a file like "env > envfile" in linux (after casstart for example). when you now add the ESSERVER.env file information, you should have all env variables which are set when the server is started.

Hope that helps!


  • Author
  • Rocketeer
  • 19312 replies
  • April 16, 2015

I'm looking for the setting of environment variables in an Enterprise Server in stopped status.  (path)  Any tips ?


#EnterpriseServer

Hi,

of course the ESSERVER.env File shows you only the values set in the browser interface. If you want all env. variables you have to check the profile of the tech. user, global profiles, your startup script,... this would be very difficult. One thing you can do is that you a line in your script, which writes your env. to a file like "env > envfile" in linux (after casstart for example). when you now add the ESSERVER.env file information, you should have all env variables which are set when the server is started.

Hope that helps!