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?
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.
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.
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.