commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Consultant Leon (JIRA)" <>
Subject [jira] [Commented] (DAEMON-366) Windows service fails to stop with error code 1053 (using Windows 7 service manager)
Date Fri, 23 Jun 2017 22:10:00 GMT


Consultant Leon commented on DAEMON-366:

Hi Bernd,
that's interesting to know indeed and thanks for trying to find us a workaround.
How to do a jstack then, on the procrun exe? Let me see what processes I do see during runtime,
not quite clear.

I'm not happy to have to call System.exit(0), this will cause more shutdown issues than it
solves and our shutdown process has been carefully rewritten not to need such call.

Calling System.exit from a shutdown handler can call jvm shutdown handler to hang for example.

Our code review tools will flag it as bad practise/critical issue as well.
So please , don't let everyone have to redesign their code to be able to hack around the introduced
bug in procrun and let's try to make it work properly as it used to. 

I'm not looking forward to have to offer support for our application to install as a service
being forced to use outdated procrun binary 1.0.14 and losing support on other issues that
may get fixed now our in the future.

> Windows service fails to stop with error code 1053 (using Windows 7 service manager)
> ------------------------------------------------------------------------------------
>                 Key: DAEMON-366
>                 URL:
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>    Affects Versions: 1.0.15
>         Environment: Windows 7 64bit - using 64-bit prunsrv.exe in jvm mode
> Using 64-bit Java JRE 1.8.0_73
>            Reporter: Consultant Leon
>            Assignee: Guillaume Chauvet
>              Labels: prunsrv, stop, windows
> Using Windows services manager (services.msc) to start/stop service.
> Service installed with the following start/stop settings.
> --StartMode=jvm --StartClass=com.myorg.MyClass --StartMethod=start 
> --StopMode=jvm --StopClass=com.myorg.MyClass --StopMethod=stop 
> Service starts OK.
> When I use services manager to stop the service, the application stops running but the
prunsrv.exe process does not terminate.
> Eventually the services manager reports that:
> "Windows could not stop the <MyServiceName> service on Local Computer.  Error 1053:
The service did not respond to the start or control request in a timely fashion."
> The service then stays at status "stopping" & cannot be restarted without first killing
the prunsrv.exe process.
> Looking at the application logs I can see that the application's stop() method gets called
- the final line in this method is a logging call which is executing OK.
> The commons-daemon-<date>.log file has the following entries:
> [2013-05-09 17:18:02] [info]  [10944] Commons Daemon procrun ( 32-bit) started
> [2013-05-09 17:18:02] [info]  [10944] Running '<MyServiceName>' Service...
> [2013-05-09 17:18:02] [info]  [ 9224] Starting service...
> [2013-05-09 17:18:11] [info]  [ 9224] Service started in 9202 ms.
> [2013-05-09 17:18:23] [info]  [10780] Stopping service...
> [2013-05-09 17:18:24] [info]  [10780] Service stop thread completed.
> This problem does not occur in daemon versions 11->14.
> I have only seen it in daemon-1.0.15

This message was sent by Atlassian JIRA

View raw message