bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.96k stars 397 forks source link

Installed service won't automatically start in Windows 10 #632

Open dabaer opened 5 years ago

dabaer commented 5 years ago

Steps to reproduce

  1. Compile the release as normal (MIX_ENV=prod mix release --env=prod)
  2. Navigate to the build bin directory (_build/prod/rel/project/bin)
  3. Install the service using project.bat install
  4. Start the service using project.bat start
  5. Reboot Windows

Verbose Logs

Windows Event viewer outputs the following error:

The project01d4b8d12dbe2a20 service terminated with the following error: The configuration registry key could not be read.

Description of issue

- What are the expected results?

- What version of Distillery?

- What OS, Erlang/Elixir versions are you seeing this issue on?

- If possible, also provide your rel/config.exs, as it is often my first troubleshooting question, and you'll save us both time :)

- Is there documentation that says one thing, but Distillery does another? If so, please link the doc here so it can be updated if it's a documentation issue, or so that the fix can be based around what's documented.

- If this is a runtime configuration issue, please also provide your config file (with any sensitive information stripped of course). This is almost always necessary to understand why some configuration may not be working.

To note, the service started fine if started manually, and on delayed start, but not on the Automatic setting.

PaoloLaurenti commented 5 years ago

I think the problem is related to this: https://groups.google.com/forum/#!topic/erlang-programming/kATOOaYBflA

PaoloLaurenti commented 5 years ago

The only "solution" I found is to set the Startup Type of the Windows Service to Automatic (Delayed Start).
I can provide a PR where the install.ps1 can set the Windows Service created by erlsrv with this configuration. @bitwalker could this be OK for you?