43546members
218143posts

The Status of a Windows service continually indicates Starting or Stopping

The Status of a Windows service continually indicates Starting or Stopping

Warning

Potential for Data Loss: The steps detailed in the resolution of this article may result in a loss of critical data if not performed properly. Before beginning these steps, make sure all important data is backed up in the event of data loss. If you are unsure or unfamiliar with any complex steps detailed in this article, please contact Product Support for assistance.

Issue

Sometimes as an administrator, you may need to kill a service which is stuck at starting or stopping in order to avoid having to reboot a server in the middle of the day. Or even after the reboot, the service will not start.

Product Line

EcoStruxure Building Operation

Environment

  • Building Operation Enterprise Server
  • Building Operation Enterprise Central
  • Building Operation Licensing Server
  • Security Expert Windows Services
  • Access Expert Windows Services (on-premise only)

Cause

Sometimes the service times out and gets stuck in a loop due to fallback protocols within the service

Resolution

Find out the name of the service

  • To do this, go into services and double click on the service which has stuck.  
  • Make a note of the “Service Name”.

Find out the PID of the service

  • Open an elevated command prompt and type in: "sc queryex servicename" (where servicename is the name of the service you obtained from Step 1).

  • Make note of the PID

Kill the PID

  • From the same command prompt type in: "taskkill /f /pid [PID]" (Where [PID] is the service number).

 

If it is successful you should receive the following message: "SUCCESS: The process with PID XXXX has been terminated." 

  

Be careful of what you are killing though. If you kill a critical windows service you may end up forcing the machine to reboot on it own.

 

If the service returns back into this state you may need to increase the time allotment for the service to start.

 

Global (entire system):

  • Open Windows Registry: Start -> Run -> regedit.exe
  • File --> Export --> make a backup of the current registry
  • Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\
  • Right click on the right page ---> New ---> DWORD
  • call the new DWORD "AutoStartDelay"
  • Set AutoStartDelay in milliseconds (decimal). E.G. 240000 is 240 seconds.

Per-service:

  • Open Windows Registry: Start -> Run -> regedit.exe
  • File --> Export --> make a backup of the current registry
  • Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<servicename>
  • To increase the default delay of 120 seconds, right click the registry key and add new key AutoStartDelay (DWORD (32-bit))
  • Set AutoStartDelay in milliseconds (decimal). E.G. 240000 is 240 seconds.
Tags (3)
No ratings
Contributors