Clean shutdown of service when Windows shutsdown/restarts

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Clean shutdown of service when Windows shutsdown/restarts

Fredrik
Hi.
I have a problem that Windows doesn't wait for my service to shutdown cleanly when shutting down/restarting Windows (tested on Windows Server 2012 R2).
Windows only waits a short amount of time before simply killing the service which results in an unclean shutdown.
I've done some research that Windows sends SERVICE_CONTROL_PRESHUTDOWN control-code before  shutting down the OS.
Is it possible to get this control code via the wrapper or do you have any other suggestions as how to handle this case.
I've also tried to set the "WaitToKillServiceTimeout" in the registry without any luck.

Regards
Fred

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user
Reply | Threaded
Open this post in threaded view
|

Re: Clean shutdown of service when Windows shutsdown/restarts

Maxime
Fred,

Thank you for reporting this issue.

How long does your service need to shutdown cleanly?

It seems that "WaitToKillServiceTimeout" has not effect on recent versions of Windows (or is limited to a value which is too low for your application to shutdown correctly).

Currently the Wrapper does not handle the SERVICE_CONTROL_SHUTDOWN control code but we are studying the possibility to implement it in our next release.

Best Regards,

Maxime

On Mon, Mar 21, 2016 at 8:06 PM, Fredrik <[hidden email]> wrote:
Hi.
I have a problem that Windows doesn't wait for my service to shutdown cleanly when shutting down/restarting Windows (tested on Windows Server 2012 R2).
Windows only waits a short amount of time before simply killing the service which results in an unclean shutdown.
I've done some research that Windows sends SERVICE_CONTROL_PRESHUTDOWN control-code before  shutting down the OS.
Is it possible to get this control code via the wrapper or do you have any other suggestions as how to handle this case.
I've also tried to set the "WaitToKillServiceTimeout" in the registry without any luck.

Regards
Fred

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user



------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user
Reply | Threaded
Open this post in threaded view
|

Re: Clean shutdown of service when Windows shutsdown/restarts

Maxime
Fredrick,

We have just released a new version (3.5.30) of the Java Service Wrapper.

In this new version, we added the ability for a service to handle the SERVICE_CONTROL_SHUTDOWN control code sent before a system shutdown. This can be simply configured by adding 'wrapper.ntservice.preshutdown=TRUE' in your configuration file.

You may also use the 'wrapper.ntservice.preshutdown.timeout' property to control how long the service manager should wait for your service to shutdown cleanly until it timeouts.

You may read the descriptions of these properties in the following page:

As usual the new version can be downloaded on sourceforge or from our website:

You may have a look at the release notes for a full list of changes:

Please let me know if you have any questions or feedback.

Best Regards,

Maxime

On Wed, Mar 23, 2016 at 5:15 PM, Maxime <[hidden email]> wrote:
Fred,

Thank you for reporting this issue.

How long does your service need to shutdown cleanly?

It seems that "WaitToKillServiceTimeout" has not effect on recent versions of Windows (or is limited to a value which is too low for your application to shutdown correctly).

Currently the Wrapper does not handle the SERVICE_CONTROL_SHUTDOWN control code but we are studying the possibility to implement it in our next release.

Best Regards,

Maxime

On Mon, Mar 21, 2016 at 8:06 PM, Fredrik <[hidden email]> wrote:
Hi.
I have a problem that Windows doesn't wait for my service to shutdown cleanly when shutting down/restarting Windows (tested on Windows Server 2012 R2).
Windows only waits a short amount of time before simply killing the service which results in an unclean shutdown.
I've done some research that Windows sends SERVICE_CONTROL_PRESHUTDOWN control-code before  shutting down the OS.
Is it possible to get this control code via the wrapper or do you have any other suggestions as how to handle this case.
I've also tried to set the "WaitToKillServiceTimeout" in the registry without any luck.

Regards
Fred

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user




------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user