saleyn / erlexec

Execute and control OS processes from Erlang/OTP
https://hexdocs.pm/erlexec/readme.html
Other
541 stars 141 forks source link

application:get_env is not properly working #76

Closed silviucpp closed 8 years ago

silviucpp commented 8 years ago

Hello,

I just added erlexec to my application dependencies and then in the sys.config I added:

    {exec,[
        {root, true}
    ]},

Once the application is starting is not finding any environment variable. I suppose because the name of the app is erlexec and not exec.

So changing the code to case application:get_env(erlexec, Option) of into the following function

add_option(Option, Acc) ->
    case application:get_env(exec, Option) of
    {ok, Value} -> [{Option, Value} | Acc];
    undefined   -> Acc
    end.

And also the app name into erlexec into sys.config fixed my issue.

What do you think ?

saleyn commented 8 years ago

Committed the fix. Thanks.

silviucpp commented 8 years ago

@saleyn I think a bug is that even if I put {root, true} and run the app as route . somehow erlexec fails and the operations are not completed fine. Without root is working fine.

Silviu