[erlang-questions] REPLACE_OS_VARS in erlexec?

Stefan Hellkvist hellkvist@REDACTED
Wed Mar 29 21:55:16 CEST 2017

Hello Erlangers,

For different reasons (for instance to be able to run distributed Erlang
inside Kubernetes for instance, like here:
there is a need to be able to override or replace the settings in vm.args
(or the args_file if you use the name of the argument to erlexec) with
environment variables.

For instance like so (example taken from the above article):

----begin vm.args----
## Name of the node

## Cookie for distributed erlang
-setcookie ${ERLANG_COOKIE}
----end vm.args-----

The need for this functionality seems to be big enough for there to now be
support for it in the release builders (relx for instance offers a way to
turn on vm.args environment variable replacement with the
RELX_REPLACE_OS_VARS environment variable when running the start script).

My question though is if this functionality (to set variables such as -name
or -setcookie in args_file through environment variables) has ever been
considered for erlexec itself?

For various reasons (mostly to reduce dependencies to other programs such
as various shell utilities) I would like to start my erlang nodes without
the generated release script by calling erlexec directly, but I realize I
would, by doing so, miss out on the power to set variables in arg-file with
environment variables (like in relx above).

I guess it would not be extremely difficult to modify erlexec for this
purpose (erlexec already has functions for reading environment variables so
it would be a small change I guess) but I'm not sure if there would be
enough interest in this feature to accept a pull-request and I would not
like to roll my own fork of OTP only for this rather limited purpose. So,
does anyone know if this this feature has ever been discussed or considered
for inclusion in OTP?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170329/44941188/attachment.htm>

More information about the erlang-questions mailing list