[erlang-questions] Erlsrv

Robert Raschke rtrlists@REDACTED
Tue Oct 11 11:20:17 CEST 2011


On Mon, Oct 10, 2011 at 10:06 PM, Michael Mileusnich <justmike2000@REDACTED
> wrote:

> Hello,
>
> Erlsrv looks very simple however I have tried many different combinations
> of commands and cannot get my server to stay active or get accurate debug
> information.  Could anybody provide me with what the command to form a
> Windows service using Erlsrv with the following command:
>
> erl -pa ebin -run hqcontroller run -extra $DATA
>
> - My beam files are in the ebin folder
>
> Thanks,
> Michael Mileusnich
>
>
Something along these lines should work:

set PATH=%ERLPATH%;%PATH%

erlsrv add "MyService" ^
    -internalservicename "MyService" ^
    -sname "MyService@REDACTED" ^
    -stopaction "init:stop()." ^
    -workdir "C:/MyWorkdir" ^
    -args "-pa ebin -run hqcontroller run -extra %DATA%" ^
    -env PATH="%PATH%"

The important bit here is the -workdir option (not sure if you need -sname
or -stopaction for your purposes), telling the service where it'll be
running. Without that, you "-pa ebin" doesn't say much. And you better make
sure your DATA env var is properly formatted/quoted, or you'll end up with
lots of bizarreness.

Robby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111011/224d947b/attachment.htm>


More information about the erlang-questions mailing list