commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Miller <andrew...@gmail.com>
Subject Re: [daemon] Java Service stop acting differently on different machines
Date Mon, 19 Aug 2013 15:11:26 GMT
Sebb gets to the heart of the matter... thanks! :)

Our service code is actually making use of 0/[nonzero] return codes to
signal to Windows on whether or not Windows should restart the Service.
What we found in a general case (except on these certain machines) is that
if a user directs to Service to stop (via the Services GUI or command line
sc command), the Service stops and doesn't restart no matter what the
return value is and how the Windows Service Recovery Options are
configured, so we didn't spend much time coding how to return 0 when a
directed stop occurs versus unexpected shutdowns/failures because of
certain fatal exceptions.  So in the case documented in this thread, we are
indeed returning an exit code of 1 intentionally.  Of course, as sebb
pointed out, on certain machines we aren't seeing the exit hook invoked,
which Windows interprets as an unexpected stop of the service and thus
invokes the Recovery Options (which is, in our case is always to restart,
no matter how many recent failures have occurred).

Our service apps are also configured to generate error log files in a well
known directory via the -XX:ErrorFile parameter
("......"\java_error_%p.txt) (passed in via the JvmOptions parameter when
the service is installed) and we aren't seeing any logs generated.  Is the
%p construct handled by Procrun?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message