You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Marat Abrarov (JIRA)" <ji...@apache.org> on 2018/04/26 22:01:00 UTC

[jira] [Commented] (DAEMON-243) Support for Failure Recovery

    [ https://issues.apache.org/jira/browse/DAEMON-243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16455451#comment-16455451 ] 

Marat Abrarov commented on DAEMON-243:
--------------------------------------

[~mturk@apache.org], it looks like there is no solution actually - I played with procrun and recovery actions recently and found below:

 # When my process exits with non-zero exit code, then procrun just *stops* Windows service with non-zero return code.
 # Windows service controller doesn't apply recovery actions for services which are stopped (no matter what is return code) - refer to "[Using the Automatic Recovery Features of Windows Services|https://mdenomy.wordpress.com/2008/02/28/using-the-automatic-recovery-features-of-windows-services/]" for details.

I guess, procrun can be extended with some option - like {{ExitMode}} - which could specify if procrun should stop service without reporting {{SERVICE_STOPPED}} status (refer to "[MSDN: SERVICE_FAILURE_ACTIONS structure|https://msdn.microsoft.com/en-us/library/ms685939(VS.85).aspx]") when child process finishes with non-zero exit code, or if procrun should handle non-zero exit code of child process the same way as it does today (default configuration for compatibility with existing installations).

What do you think about this?

The only way I found to make Windows service recovery actions working is to kill prunsrv.exe process. Unfortunately it doesn't work for me because:

# It's more complicated comparing to application which just exits with non-zero exit code and assumes that admin can configure recovery actions by means of OS.
# I want to use application (JBoss) in both ways - as Windows service and as console application. If I configure Java out-of-memory action to kill not Java process (with non-zero exit code) but to kill prunsrv.exe process then such solution will work only when application is launched as Windows service, while making procrun able to terminate service by non-zero exit code of child process will cover both cases I need.

> Support for Failure Recovery
> ----------------------------
>
>                 Key: DAEMON-243
>                 URL: https://issues.apache.org/jira/browse/DAEMON-243
>             Project: Commons Daemon
>          Issue Type: New Feature
>          Components: Procrun
>    Affects Versions: 1.0.10
>         Environment: MS Windows
>            Reporter: Peter Ehrbar
>            Priority: Minor
>
> The MS Windows Service Controller provides functionality to perform some basic failure recovery actions: Restart service or execute any command or restart the machine. This can be configured using the Service Controller GUI or in a shell with SC.EXE (commands FAILURE and FAILUREFLAG).
> It would be convenient if this could be configured also using procrun.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)