on 01-27-2016 12:23 PM
Hi,
Is it possible to have a windows based script which looks to see if tomcat stopped and restarts automtically if in stopped state between certain hours?
Any examples or downsides to this?
Occasionally we see tomcat in stopped state and restart manually as it has crashed.
Thanks
You can also specify in Windows Services, on the Recovery tab, to automatically restart the service if it quits unexpectedly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for suggestions.
Re the recovery tab - had a look at that - is there an option within this can say only do this between certain hours
e.g we deliberately stop tomcat daily via scripts at 2.00 .a.m and restart at 4.00 a.m - this is when etl running and backups take place so if tomcat stopped via this script wouldn't want it to start again automatically but would at all other times.
I believe that option only kicks in when the service fails or quits unexpectedly, if you manually stop it should not be automatically restarted.
HI Brian,
I believe above script should work because what you are doing is this script will check the service if it is running or not. You terminate it manually or automatically it get killed. If found that the service is not running then it will start the service.This script will be running automatically in background with task scheduler.
If you wanted a proper script you can check "AutoHotKey Software" and simply create a proper script. This software then convert the script to .exe and simply run it.
hope this will help.
Regards,
Mahak
Hi Philip,
You can use Simple BAT file to check and start the Service not only tomcat but any service.
In this case Default Tomcat Service Name is : BOEXI40Tomcat or you can check the services.msc .
Below is the sample script :
Try:
net start | find "servicename" > nul 2>&1
if not .%errorlevel%.==.0. goto startservice
goto skip
:startservice
net start "servicename"
echo service restarts @ %date% %time% >> C:\checklog.txt
:skip pause
Hope this will help.
regards,
Mahak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i cant provide you any proven Details but what i know is that a lot of customers are using all Kind of 3rd Party Monitoring Tools for that. If a .exe crashes, the Monitoring Tool restarts it.
So basically yes, this is possible.
Regards
-Seb.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.