Problem with vm.args app env

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with vm.args app env

Oliver Korpilla
Hello,

I have a vm.args file and I try to do the following:

-my_app config name-of-config.xml

where my_app is indeed the name of the application.

But I get:

{"init terminating in do_boot",{error,'Bad environment variable: "name-of-config.xml"  Application: my_app'}}

I get this also if I write:

-my_app config 'name-of-config.xml'
-my_app config "name-of-config.xml"

I just want to pass a few configuration parameters in but it does not seem to work.

Thank you,
Oliver
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Problem with vm.args app env

Jesper Louis Andersen-2
You are trying to use `name-of-config.sml` as an erlang term. It isn't valid because it is not a valid erlang term since it has a . in it. You can wrap it in quotes to make it a string. Do note that variable expansion in the shell may affect you, so we wrap it in single quotes to avoid variable expansion inside. Example:

[jlouis@lady-of-pain ~]$ erl -kernel config '"name-of-config.xml"'
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V9.0  (abort with ^G)
1> application:get_env(kernel, config).
{ok,"name-of-config.xml"}


On Sat, May 27, 2017 at 1:17 PM Oliver Korpilla <[hidden email]> wrote:
Hello,

I have a vm.args file and I try to do the following:

-my_app config name-of-config.xml

where my_app is indeed the name of the application.

But I get:

{"init terminating in do_boot",{error,'Bad environment variable: "name-of-config.xml"  Application: my_app'}}

I get this also if I write:

-my_app config 'name-of-config.xml'
-my_app config "name-of-config.xml"

I just want to pass a few configuration parameters in but it does not seem to work.

Thank you,
Oliver
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Problem with vm.args app env

Oliver Korpilla
Thank you, Jesper.

I wasn't aware such '" "' quoting was necessary in an vm.args file.

It solved my problem!

Again, thanks!

Oliver
 

Gesendet: Samstag, 27. Mai 2017 um 16:08 Uhr
Von: "Jesper Louis Andersen" <[hidden email]>
An: "Oliver Korpilla" <[hidden email]>, [hidden email]
Betreff: Re: [erlang-questions] Problem with vm.args app env

You are trying to use `name-of-config.sml` as an erlang term. It isn't valid because it is not a valid erlang term since it has a . in it. You can wrap it in quotes to make it a string. Do note that variable expansion in the shell may affect you, so we wrap it in single quotes to avoid variable expansion inside. Example:
 
[jlouis@lady-of-pain ~]$ erl -kernel config '"name-of-config.xml"'
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]
 
Eshell V9.0  (abort with ^G)
1> application:get_env(kernel, config).
{ok,"name-of-config.xml"}
  

On Sat, May 27, 2017 at 1:17 PM Oliver Korpilla <[hidden email][mailto:[hidden email]]> wrote:Hello,

I have a vm.args file and I try to do the following:

-my_app config name-of-config.xml

where my_app is indeed the name of the application.

But I get:

{"init terminating in do_boot",{error,'Bad environment variable: "name-of-config.xml"  Application: my_app'}}

I get this also if I write:

-my_app config 'name-of-config.xml'
-my_app config "name-of-config.xml"

I just want to pass a few configuration parameters in but it does not seem to work.

Thank you,
Oliver
_______________________________________________
erlang-questions mailing list
[hidden email][mailto:[hidden email]]
http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions