[erlang-questions] How to start a .app from os's shell

Anders Nygren <>
Mon May 12 05:23:12 CEST 2008

2008/5/11 wenew zhang <>:
> Actually, It's works with domain name,i start erl shell like below,
> erl -name  -setcookie abc -boot
> start_sasl -config socketlog
> and then start socketserver under erl-shell
> like:application:start(socketserver).
> i try :erl -name  -setcookie abc
> -boot start_sasl -config socketlog -s application start socketserver
> it's start a process,but socketserver doesn't  start

>From the erl documentation
-s Mod [Func [Arg1, Arg2, ...]](init flag)
    Makes init call the specified function. Func defaults to start. If
no arguments are provided, the function is assumed to be of arity 0.
Otherwise it is assumed to be of arity 1, taking the list
[Arg1,Arg2,...] as argument. All arguments are passed as atoms.

So the problem You have is that the -s application start socketserver
leads to a call like

application:start([socketserver]) where the application name is inside
a list, so
appliaction:start fails since it expects an atom.

If You instead add a function e.g
socketserver:start() ->

and start Your application with -s socketserver start
it should work.


> maybe i should study to write .boot file
> Wenew Zhang
> _______________________________________________
> erlang-questions mailing list
> http://www.erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list