[erlang-questions] run an otp/application as a service
Thu Jul 23 12:08:49 CEST 2009
On Thu, Jul 23, 2009 at 11:34, info<> wrote:
> I tried erlsrv.exe add ServiceName -args -s application:start(my_application)
> as I do it with Eclipse from the console.
>From the docs:
-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.
so even if you call it like it's supposed to be
-s application start my_application
what will be called is application:start([my_application]) which won't
work (notice the argument is a list).
You should add your own startup function and let that start
applications and whatever else you need.
More information about the erlang-questions