Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

start erlang application from command line

Tags:

erlang

rebar

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?

like image 936
LtWorf Avatar asked Apr 30 '13 14:04

LtWorf


People also ask

How do I start Erlang?

On a Unix system you enter the command erl at the operating system prompt. This command starts the Erlang runtime system and the Erlang shell. On the Windows platform you normally start Erlang/OTP from the start menu. You can also enter the command erl or werl from a DOS box or Command box.

How do I close Erlang shell?

If you then press a (for abort) you will exit the shell directly. Other ways of exiting the erlang shell are: init:stop() which does the same thing as q() or erlang:halt() .

What is Erlang application?

Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability. Some of its uses are in telecoms, banking, e-commerce, computer telephony and instant messaging.

How do I stop Erlang process?

A process can terminate itself by calling one of the BIFs exit(Reason), erlang:error(Reason), erlang:error(Reason, Args), erlang:fault(Reason) or erlang:fault(Reason, Args). The process then terminates with reason Reason for exit/1 or {Reason,Stack} for the others.


1 Answers

You can do:

erl -pa ebin -eval "application:start(myapp)"

If you want it to run in the background, add -noshell -detached

like image 183
Chris Avatar answered Oct 01 '22 04:10

Chris