[erlang-patches] Gracefully stop emulator on Windows shutdown when run as a service

Jan Klötzke <>
Wed Aug 1 09:53:57 CEST 2012


Hi,

Currently, when running the emulator as a windows service, the emulator will 
be killed when Windows is shutting down instead of invoking the stop action 
for a graceful tear down. The following patch, based on 'maint' fixes the 
problem:

git fetch git://github.com/jkloetzke/otp.git erlsrv-graceful-shutdown

https://github.com/jkloetzke/otp/compare/erlsrv-graceful-shutdown
https://github.com/jkloetzke/otp/compare/erlsrv-graceful-shutdown.patch

The patch fixes erlsrv to gracefully stop the emulator on Windows shutdown. 
Windows will send the SERVICE_CONTROL_SHUTDOWN event to the service control 
handler when shutting down the system. Instead of ignoring the event, erlsrv 
will now invoke the stop action. Likewise, the Erlang emulator (and it's port 
drivers) must not quit upon reception of the CTRL_SHUTDOWN_EVENT event in the 
console control handler.

Regards,
Jan
_____________________________________________________________________________
PeerDrive - Beyond online storage

Store, sync, backup and organize your   http://peerdrive.org
data everywhere without relying on a    http://github.com/jkloetzke/peerdrive
permanent network connection.


More information about the erlang-patches mailing list