[erlang-questions] run an otp/application as a service

Robert Raschke rtrlists@REDACTED
Thu Jul 23 19:35:31 CEST 2009


On Thu, Jul 23, 2009 at 6:15 PM, info <info@REDACTED> wrote:

>  Hi Robby,
> You, you know how to read the doc !
> I progress ...
> The events observer gives this:
> Erlang machine stopped instantly (distribution name conflict?). The service
> is not restarted as OnFail is set to ignore.
> Any idea ?
> If I resume the situation:
> - my OTP application runs correctly in Eclipse;
> - my OTP application hangs in werl.exe
> - erlsrv.exe add ServiceName -args "-s startting"   add the service to the
> system
> - erlsrv.exe start ServiceName start the service but the observer gives the
> above message and the service doesn't start.
>
>

Do you require a given node name? You can add one using the -name option:

erlsrv add ServiceName -name mynode -args "-s startting"

And if you are dependent on finding stuff on your PATH and running in a
particular folder, you may want to set those on the running service as well,
e.g.:

erlsrv add ServiceName -name mynode -workdir C:/TEMP -env PATH=%PATH% -args
"-s startting"

And if you have a proper OTP release structure, then start your service with
the boot and config options. For example:

erlsrv add ServiceName -name mynode -workdir C:/TEMP -env PATH=%PATH% -args
"-boot myboot -config myconfig -setcookie mycookie"

Oh, and it helps tremendously if everything is running in a folder that has
no spaces! Windows is juuust grrreat!

Robby


More information about the erlang-questions mailing list