Question

I'm trying to get an erlang app to run as a Windows service with long node names, but the -name flag for erlsrv doesn't seem to work. The service seems to run, but doesn't show up in epmd with net_adm:names(). However, when I use the -sname flag instead, it seems to work.

I'm using Rebar to generate my release scripts. Here is the section of the script which installs the service:

:install
@set description=Erlang node %node_name% in %node_root%
@set start_erl=%node_root%\bin\start_erl.cmd
@set args= ++ %node_name% ++ %node_root%
@%erlsrv% add %service_name% -c "%description%" -name %node_name% -args "%args%" -w "%node_root%" -m "%start_erl%" -stopaction "init:stop()."
@goto :EOF

How can I get this service to work with long node names?

Was it helpful?

Solution

It turns out that the vm.args file specifies a name also, which can conflict with the name specified on the erlsrv command. I fixed it by making a new win_vm.args without the -name parameter, and changing the start_erl.cmd to look for the windows version of the file. I also changed all the -sname to -name options in the application cmd script.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top