[erlang-questions] specifying OS-level environment variables
Ivan Uemlianin
ivan@REDACTED
Wed Nov 30 13:36:06 CET 2016
Dear Sergej
Excellent thanks. That looks like the tight way to do it.
Best wishes
Ivan
On 30/11/2016 12:12, Sergej Jurečko wrote:
> I would put a default value into vm.args
>
> -env Variable Value
>
> and start your app with: -args_file path/to/vm.args
>
>
> regards,
> Sergej
>
>> On 30 Nov 2016, at 11:35, Ivan Uemlianin <ivan@REDACTED> wrote:
>>
>> Dear All
>>
>> I am writing an erlang application, and one of its dependencies requires an OS environment variable to be set. For sake of argument:
>>
>> XYZ_HOME = /path/to/lib/
>>
>> What is the best way to express this requirement to the user? I can think of two ways. Are there other, better, ways?
>>
>> 1. Just put it in the documentation, along with other system requirements: "Needs XYZ_HOME to be set otherwise won't work."
>>
>> 2. Put a "sensible default" in the .app.src and/or sys.config, document these application configs, and during application startup use os:putenv, e.g.:
>>
>> {ok, XYZ_HOME} = application:get_env(myapp, xyz_home),
>> os:putenv("XYZ_HOME", XYZ_HOME),
>>
>> The first doesn't seem very friendly and I shouldn't think will be very effective. Is the second a correct use case for os:putenv?
>>
>> Is there a third way that is even better?
>>
>> With thanks and best wishes
>>
>> Ivan
>>
>>
>> --
>> ============================================================
>> Ivan A. Uemlianin PhD
>> Llaisdy
>> Speech Technology Research and Development
>>
>> ivan@REDACTED
>> @llaisdy
>> llaisdy.wordpress.com
>> github.com/llaisdy
>> www.linkedin.com/in/ivanuemlianin
>>
>> festina lente
>> ============================================================
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
--
============================================================
Ivan A. Uemlianin PhD
Llaisdy
Speech Technology Research and Development
ivan@REDACTED
@llaisdy
llaisdy.wordpress.com
github.com/llaisdy
www.linkedin.com/in/ivanuemlianin
festina lente
============================================================
More information about the erlang-questions
mailing list