[erlang-questions] erlsrv shutdown on server restart
Tue Nov 15 15:50:44 CET 2011
On Tue, Nov 15, 2011 at 11:41 AM, Emile Joubert <emile@REDACTED> wrote:
> 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?
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions