Monday 17 May 2010

Service stuck in Starting/Stopping state


I've seen this scenario so many times - you go to start or stop a service in Central Administration (Operations tab > Services on Server) and you wait... and you wait... but the service just sits there saying Starting or Stopping. It appears from Central Admin that there is no way to resolve this as you can't re-initiate the start/stop command through the UI.

This is where STSADM comes to the rescue, and the very handy ProvisionService operation. Details on this can be found here http://technet.microsoft.com/en-us/library/cc262031(office.12).aspx

This command allows you to re-initiate the start/stop command and in most cases will fix this issue for you. It's also very handy for scripting a farm build. The syntax is

stsadm -o provisionservice -action [start/stop] -servicename [name] -servicetype [type]

The values you're expected to enter for servicename and servicetype are not immediately obvious - if you run stsadm -o enumservices you can see all the details but they're not exactly readable, so I've laid these out in the table below. Where the ServiceName column is null, you don't need to include that parameter and you can just use -servicetype. Where both servicename and servicetype exist, you must include both.


2 comments:

  1. In my case the Unprovision fails because of an "update conflict". I am supposed to check teh trace logs for more information according to the command line, but the trace log has the exact same error message text as the command line. So in summary I can't delete the service from the UI, from 2010 Powershell commands or STSADM commands, and my installation won'r work unless I delete this corrupted service. Way to go microsoft

    ReplyDelete
  2. cheers the minor detail that you need both identifier did the trick

    ReplyDelete