1

I have tried all the solutions I have found in Google and StackOverflow to auto start a Windows service.

Here's my problem:

I have registered my WebSphere application server instance as a service. I'm able to stop & start the WebSphere using service. I set auto start using recovery from service properties. (changed service to Automatic & also checked with Automatic delayed)

When I terminate the process id, service is not getting started automatically as expected.

Can anyone please explain clearly what else to do?

Dave M
  • 4,494
  • 21
  • 30
  • 30
Sunny
  • 55
  • 6

3 Answers3

1

There are two processes involved, the service process (wasservice.exe) and the WebSphere server process (java.exe). Recovery methods depend on which process is being killed. If the WebSphere process is being killed, setting the "restart" option on the service (when the service is created) will restart the WebSphere process. If the service is being killed, the service can be configured to restart from the Windows Services. Select Properties for the service and configure the options under the Recovery tab.

1

The "Automatic" setting for Windows services will simply start the service when the computer starts up. It doesn't keep track of all services and restart them should they stop on their own. You'd need a watchdog process to monitor your service.

The Recovery tab as I understand only functions if the service itself fails to start for whatever reason and not if it stops on its own after it was successfully started.

Nathan C
  • 14,901
  • 4
  • 42
  • 62
  • Thanks Nathan, But here my question is not at startup. – Sunny May 18 '16 at 15:13
  • I understand, just wanted to clarify exactly what the modes meant. It being "Automatic" won't affect the service post-startup. – Nathan C May 18 '16 at 15:13
  • Recovery tab settings are not helping my instance recover from failure/stop. – Sunny May 18 '16 at 15:14
  • 1
    As I mentioned in my answer, Recovery only helps if it fails to actually start the service and not if it stops by you killing the process. – Nathan C May 18 '16 at 18:36
  • Thanks Natha, Then what is the solution if the process gets abruptly stopped or killed ? – Sunny May 25 '16 at 11:42
1

You need a manager service working like websphere node agent. You can write a script about checking status of application server service in a fixed time interval. Then install script as a windows service. If somehow service of application server is not running, the script starts it again.

sozkul
  • 126
  • 2