?
Solved

Auto restart scheduler service when it fails?

Posted on 2007-10-20
7
Medium Priority
?
1,512 Views
Last Modified: 2013-12-05
I have a fairly critical scheduled job that runs fairly often but I find that once in a while the scheduler service has stopped.  It only needs to be restarted to get it going.  Does anyone have any ideas how to avoid this?  I was thinking on having a scheduled job run on another windows 2000 box that would automatically restart the service on this box but I am not certain how to go about doing that.

Any ideas?
0
Comment
Question by:jglazer63
  • 3
  • 2
  • 2
7 Comments
 
LVL 85

Expert Comment

by:oBdA
ID: 20115429
Have you tried the "Recovery" tab in the service's properties yet? You can configure the service to be restarted automatically by the SCM when it fails (note that it will only be restarted if the service actually fails, not if it is shutdown gracefully through services.msc or whatever).
0
 

Author Comment

by:jglazer63
ID: 20115499
yes its already set to restart after first, second and subsequent.  Reset fail count after 0 days and restart after 1 minute.  Didn't seem to make it restart though.

0
 
LVL 85

Accepted Solution

by:
oBdA earned 2000 total points
ID: 20115579
Then the next easiest thing to do is probably to use SrvAny from the W2k3 Resource Kit (has to be installed on W2k3 or XP, but the necessary files can be copied over to your W2k machine) to run a small batch file as service that monitors the task scheduler. Copy sleep.exe from the Resource Kit as well.

@echo off
:: *** Pause (in seconds) between checking the task scheduler's state:
set Pause=300
:: *** Name of the service to be monitored, as listed in "net start" output:
set Service=Task Scheduler
:Loop
net start | find /i "%Service%"
if errorlevel 1 net start start "%Service%"
sleep %Pause%
goto :Loop

Windows Server 2003 Resource Kit Tools
http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 9

Expert Comment

by:dreamyguy
ID: 20130086
I think we need to aproach this issue at the root. Instead of restarting the service when it fails, we need to first see why it's failing. Could you paste the errors that you see in the event viewer related to the service failure?
0
 
LVL 9

Expert Comment

by:dreamyguy
ID: 20130122
could you also paste the SchedLgU.txt here? That might give us some more information.
It can be viewed by going to scheduled tasks-->advanced-->view log.
0
 

Author Comment

by:jglazer63
ID: 20130827
I no longer have the log.  I'll try to grab if it fails again in the short run.
0
 

Author Comment

by:jglazer63
ID: 20169064
The srvany approach works.  It happened again and I don't know why.  Please note that you have two "starts" in the "net start" command but that was an easy thing to recognize/fix.

Thanks!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Case Summary: In this Article we introduce the new method to configure the default user profile using Automated profile copy with sysprep rather than the old ways such as the manual copy of a configured profile to default user profile Old meth…
This is my 3rd article on SCCM in recent weeks, the 1st (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_Server_2008/A_4466-A-beginners-guide-to-installing-SCCM2007-on-Windows-2008-R2-Server.html) dealing with installat…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question