[erlang-questions] erlexec and its environment

David Welton davidnwelton@REDACTED
Tue May 7 10:34:59 CEST 2013


Hi,

We're doing some work to fix up a few things we perceive as
deficiencies in erlexec, and thought about asking for a community
opinion.

Currently, this:

    exec:run_link("exec /tmp/print_env.sh", [])

Launches the child process with no environment, which was quite a
surprise to us - the default on Unix systems is to have child
processes inherit the parent process' environment.  We're hacking the
system so that it'll behave like we expect.

When an environment is specified, we were thinking to use that to say
"ok, clear out the environment and don't inherit it":

     exec:run_link("/tmp/print_env.sh", [{env, ["VIVA=ERLANG"]}])

So that if you really needed to pass it in, you could do:

     exec:run_link("/tmp/print_env.sh", [{env, os:getenv() ++ ["VIVA=ERLANG"]}])

Thoughts?
--
David N. Welton

http://www.welton.it/davidw/

http://www.dedasys.com/



More information about the erlang-questions mailing list