Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8AEB7D548 for ; Tue, 16 Oct 2012 12:29:04 +0000 (UTC) Received: (qmail 29646 invoked by uid 500); 16 Oct 2012 12:29:04 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 29589 invoked by uid 500); 16 Oct 2012 12:29:04 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 29570 invoked by uid 99); 16 Oct 2012 12:29:03 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Oct 2012 12:29:03 +0000 Date: Tue, 16 Oct 2012 12:29:03 +0000 (UTC) From: "Mladen Turk (JIRA)" To: issues@commons.apache.org Message-ID: <1260383339.51181.1350390543745.JavaMail.jiratomcat@arcas> In-Reply-To: <1289271895.11475.1330685939018.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (DAEMON-244) prunsrv does not propagate exit code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DAEMON-244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13476958#comment-13476958 ] Mladen Turk commented on DAEMON-244: ------------------------------------ Could you reattach the patch with 'diff -u' > prunsrv does not propagate exit code > ------------------------------------ > > Key: DAEMON-244 > URL: https://issues.apache.org/jira/browse/DAEMON-244 > Project: Commons Daemon > Issue Type: Bug > Components: Procrun > Affects Versions: 1.0.10 > Environment: MS Windows > Reporter: Peter Ehrbar > Attachments: exit_code_patch_on_1_0_10.txt > > > In order to perform recovery actions (e.g. restart service) the Windows Service Controller needs to detect abnormal program terminations (failures). The Service controller detects a failure if either the service process crashes or the process terminates with a non-zero exit code. > For my Java server application I want to define recovery actions for the following conditions: > 1) VM crash > 2) Error was thrown (e.g. OutOfMemoryError) > 3) System.exit() with non-zero exit code > When using prunsrv as a wrapper, I observe the following behaviour: > 1) VM crash is detected only when StartMode=jvm, otherwise the Service Controller ignores the failure situation > 2) When an Error is thrown and StartMode=jvm, prunsrv does not terminate but seems to hang. Therefore, the Service Controller is not aware of the failure. For other StartModes, prunsrv terminates, but the Service Controller does not detect the failure. > 3) When System.exit(42) is called, prunsrv terminates but the Service Controller does not detect the non-zero exit code. This applies for all StartModes. > It seems to me as if prunsrv always terminates with exit code zero. But I expect the following behaviour: > 1) VM crash with StartMode=jvm -> OK as it is now, but with other StartModes, prunsrv should terminate with a non-zero exit code in order to indicate the abnormal termination. > 2) When an Error is thrown, prunsrv should terminate with a non-zero exit code in order to indicate the abnormal termination. > 3) When System.exit() is called, prunsrv should terminate with the exit code passed to System.exit() (transparent behaviour), in order to let the application indicate a failure situation. > With the current behaviour, it is not possible to let the Windows Service Controller perform recovery actions. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira