skip to main | skip to sidebar

Miscellany

Friday, November 13, 2009

Configure Service Recovery from CMD Prompt

When a windows service unexpectedly exits, it can be nice to have it try to restart itself. You can do this from the CMD prompt instead of wading through the computer management applet with the following command:

sc \\<server_name> failure <service_name> actions= restart/60000/restart/60000/restart/60000 reset= 0

This configures the failure action for the <service_name> service on <server_name> server to restart when it unexpectedly fails on the first failure, the second failure, and all subsequent failures after a 60 second wait (the restart/60000 pairs represent the three recovery stages). It sets the failure counter so it does not reset.

Posted by KenJ at 12:22 PM

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Followers

Blog Archive

  • ►  2018 (1)
    • ►  September (1)
  • ►  2010 (1)
    • ►  September (1)
  • ▼  2009 (9)
    • ▼  November (3)
      • Configure Service Recovery from CMD Prompt
      • Windows Server 2008 R2 as a Workstation
      • Data Loss
    • ►  July (1)
    • ►  June (1)
    • ►  January (4)
  • ►  2008 (1)
    • ►  October (1)

About Me

My photo
KenJ
SQL Server DBA .NET Developer
View my complete profile