<br><div class="gmail_quote">On Tue, Nov 15, 2011 at 11:41 AM, Emile Joubert <span dir="ltr"><<a href="mailto:emile@rabbitmq.com">emile@rabbitmq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
Services managed by erlsrv don't seem to get the opportunity to shutdown<br>
gracefully when the OS shuts down. From looking at erlsrv_service.c,<br>
SERVICE_CONTROL_PRESHUTDOWN is not registered, and nothing happens on<br>
receipt of SERVICE_CONTROL_SHUTDOWN.<br>
<br>
Is there any way to ensure a graceful shutdown of services managed by<br>
erlsrv when the server shuts down or restarts?<br>
<br>
<br>
Thanks<br>
<br>
Emile<br>
<br></blockquote><div><br>If you specify the -stopaction option when registering the service, then that code will be called on normal shutdown.<br><br>For example -stopaction "init:stop()." does exactly what I expect when the service gets the shutdown message from Windows.<br>
<br>I haven't read the code, though. :-)<br><br>Another rather useful option is -internalservicename, which sets an explicit visible service name, instead of the strange hex stamped one you get by default.<br><br>Robby<br>
<br></div></div>