When the system shuts down, it will wait a short time (generally between 5 to 20 seconds) for the services to terminate cleanly. Beyond this limit, all services that keep running will be killed. In most cases, the services have enough time to stop normally, but some might need more time to perform cleanup tasks.
Before shutting down, the system will send a 'preshutdown' notification. A service that needs additional time can handle this notification by setting wrapper.ntservice.preshutdown to TRUE. This will cause the system shutdown to be blocked until the service stops or the preshutdown timeout expires.
The default value is "FALSE".
Blocking the system shutdown may affect the user experience. This property should be set to TRUE only if the cleanup tasks of the stopping process are absolutely necessary.
These properties are only used on Windows platforms. They are ignored on Windows Itanium, Windows XP and lower. For these versions of Windows, a possible workaround is to edit the "WaitToKillServiceTimeout" registry key, but this is not really recommended as it would apply to all the services of the system.
The wrapper.ntservice.preshutdown property can be changed without reinstalling the service. However, starting with Wrapper version 3.5.37, changes on wrapper.ntservice.preshutdown.timeout will not take effect until the Windows Service is reinstalled.