tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Procrun and Tomcat service/OS shutdown on Windows
Date Mon, 18 Mar 2013 17:38:47 GMT
Harris, Jeffrey E. wrote:
>> -----Original Message-----
>> From: Jeffrey Janner []
>> Sent: Monday, March 18, 2013 12:27 PM
>> To: 'Tomcat Users List'
>> Subject: RE: Procrun and Tomcat service/OS shutdown on Windows
>>> -----Original Message-----
>>> From: Harris, Jeffrey E. []
>>> Sent: Thursday, March 14, 2013 11:52 AM
>>> To: Tomcat Users List
>>> Subject: RE: Procrun and Tomcat service/OS shutdown on Windows
>>> Edit the registry so Tomcat depends on the HSQLDB shutdown.  This
>> only
>>> works if HSQLDB is also started as a service.
>>> Edit the service entry in the registry (under
>>> HKEY_Local_Machine\system\currentcontrolset\services\<Tomcat Service
>>> Name>) so Tomcat depends on HSQLDB.  This only works if HSQLDB is
>> also
>>> started as a service.  If HSQLDB is started some other way (i.e., by
>>> the Tomcat web app), you can try and install it as a service using
>> the
>>> srvany utility (or possibly the sc utility).
>>> If you can configure Tomcat to be dependent on HSQLDB, this will also
>>> force HSQLDB to start before Tomcat.
>> I just wanted to post a word of warning on depending on this last
>> "feature".
>> While Windows will start the HSQLDB server before the Tomcat server, it
>> doesn't necessarily imply that the DB will be ready for service.  As
>> soon as the HSQLDB service reports "started", Windows will start the
>> next service that's dependant on it.  You will want to verify the
>> behavior of your database before relying on this feature.
>> Spoken as one bitten by trying to do this with Oracle some years back.
>> The Oracle DB will report started looong before the recovery process is
>> complete and the DB is open for connections.
>> Jeff
> Good point!

An additional note maybe :
This may or may not be applicable to Tomcat running as a Service through procrun, but 
having written programs in Perl which act as Windows Services, I know that the "service 
program" itself can indicate to Windows how long it will take to start it as a service or

stop it as a service.  This then conditions Windows (probably the "Windows Service 
Manager") to wait that long, before it declares the Service as non-responsive (and, in the

case of a "stop service" signal, starts taking more drastic action).
For example, this impacts the "progress bar" which you see during a "start service" or 
"stop service" action in the GUI interaction with Services.  If the Service tells Windows

that it needs one full minute to start, then that progress bar will take a minute to reach

I do not know if procrun currently allows the setting of this kind of parameter.  But if 
it doesn't, and if this would help you, you could always file an enhancement request.

Note that I do use this in the programs mentioned above, without really understanding how

it works deep down.  It is all a bit weird, because it doesn't seem to be 100% 
deterministic, and involves a Windows "Event loop" with "messages" between the program and

the Service Manager.  But in my case it does work for where I wanted it to work, and I 
never dug deeper.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message