[erlang-questions] erlsrv shutdown on server restart
Robert Raschke
rtrlists@REDACTED
Tue Nov 15 15:50:44 CET 2011
On Tue, Nov 15, 2011 at 11:41 AM, Emile Joubert <emile@REDACTED> wrote:
> Hi,
>
> Services managed by erlsrv don't seem to get the opportunity to shutdown
> gracefully when the OS shuts down. From looking at erlsrv_service.c,
> SERVICE_CONTROL_PRESHUTDOWN is not registered, and nothing happens on
> receipt of SERVICE_CONTROL_SHUTDOWN.
>
> Is there any way to ensure a graceful shutdown of services managed by
> erlsrv when the server shuts down or restarts?
>
>
> Thanks
>
> Emile
>
>
If you specify the -stopaction option when registering the service, then
that code will be called on normal shutdown.
For example -stopaction "init:stop()." does exactly what I expect when the
service gets the shutdown message from Windows.
I haven't read the code, though. :-)
Another rather useful option is -internalservicename, which sets an
explicit visible service name, instead of the strange hex stamped one you
get by default.
Robby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111115/2cb523d2/attachment.htm>
More information about the erlang-questions
mailing list