bitwalker / distillery-test

Elixir application which demonstrates a bare-minimum release-ready app using Distillery.
16 stars 12 forks source link

Windows failed to start service test_0.0.2 #4

Closed jpmec closed 7 years ago

jpmec commented 8 years ago

I am trying to use exrm to package services on Windows. But I cannot get the exrm-test to start? I am very eager to use exrm on Windows for services, so please ask anything you need to help fix this issue.

PS C:\users\Josh\Documents\GitHub\exrm-test> .\rel\test\bin\test install
"Using C:\Users\Josh\Documents\GitHub\exrm-test\rel\test\releases\0.0.2\test.bat"
C:\Users\Josh\Documents\GitHub\exrm-test\rel\test\erts-7.1\bin\erlsrv.exe: Service test_0.0.2 added to system.

PS C:\users\Josh\Documents\GitHub\exrm-test> .\rel\test\bin\test start
"Using C:\Users\Josh\Documents\GitHub\exrm-test\rel\test\releases\0.0.2\test.bat"
[32mGenerated sys.config in C:/Users/Josh/Documents/GitHub/exrm-test/rel/test/releases/0.0.2
C:\Users\Josh\Documents\GitHub\exrm-test\rel\test\erts-7.1\bin\erlsrv.exe: Failed to start service test_0.0.2.
Error: The process terminated unexpectedly.
bitwalker commented 8 years ago

@jpmec I'll have to try and test this on my windows box at home when I can get a chance, unfortunately I haven't done much work on Windows since it's a rather uncommon target so far. I would like to get this addressed though, so I'll take a look as soon as I can.

dynamite-ready commented 8 years ago

Works for me. At first, I ran (in an Admin command console):

test install

Then:

test.start

And got the exact same error message as you did. So I uninstalled with:

test.bat uninstall

then:

test.bat install

finally:

test.bat start

And it worked fine. So I'm guessing dropping the '.bat' suffix picks up the script intended for Bash instead.

bitwalker commented 8 years ago

There is a bunch of Windows support work coming to master soon, so hopefully this issue will be one of the ones fixed. Just waiting on an updated PR to merge.

critch commented 8 years ago

I have been trying to get this to work as well. Oddly enough @dynamite-ready has the workaround, but for the wrong reasoning. Windows normally can't execute sh files, not without cygwin or similar tools. So the bat ending is not the reason.

On my test instances, you have to install and uninstall once before that application will work. So the first steps in @dynamite-ready's explanation are really the setup phase. The second time around it works right, and will start automatically upon reboot of the windows machine.

This has been tested up through version 1.0.2 of exrm, and on coonce fork as well.

dynamite-ready commented 8 years ago

@critch - Good point. I do tend to take the bash shell changes from my Windows GIT installation for granted, so in my case I'm pretty sure that the muddled filename extensions were the cause.

As for the "uninstall/install" step, that's really just to ensure that It cleans/uninstalls whatever's left behind by the mistake of accidentally running the .sh script... If you make sure to use the .bat extension in the first place, then:

test.bat install

&

test.bat start
critch commented 8 years ago

@dynamite-ready That is what is expected to work. I have not had that experience yet. Running it twice is what I have had to do when on Windows. I also seem to have to manually start epmd.exe with --daemon the first time around as well. But maybe that is a different problem.

bitwalker commented 8 years ago

/cc @OnorioCatenacci

Onorio has been working on getting stuff working better on Windows, so he'd be interested in this. Sadly I don't have a way to test on Windows anymore, at least not without downloading a copy of it and running in a VM. Any help diagnosing issues goes a long way towards helping folks like Onorio get things up to parity with *NIX.

shersh commented 8 years ago

Hi guys, any news with this bug? This bug is actual for me too. I tested it in Windows Server 2008 and Windows 10.

OnorioCatenacci commented 8 years ago

@shersh This should have been fixed a while ago. I'd need to see your event logs to figure out why it's not working for you.