I have an erlang application, compiled with rebar.
Normally I start it with like this:
application:start(myapp).
from inside the erl shell.
Could anyone tell me how to start it like a normal command line program?
I have an erlang application, compiled with rebar.
Normally I start it with like this:
application:start(myapp).
from inside the erl shell.
Could anyone tell me how to start it like a normal command line program?
You can do:
erl -pa ebin -eval "application:start(myapp)"
If you want it to run in the background, add -noshell -detached
Create shell script, something like that:
exec erl -pa ebin/ deps/*/ebin -s myapp
Other options which you need see http://www.erlang.org/doc/man/erl.html.
erl -s myapp
to work you need to write a function in your myapp.erl as start() -> application:start(myapp).
-s option is to call the MFA. By default it calls start without passing parameters if only module name is specified. –
Peahen © 2022 - 2024 — McMap. All rights reserved.