Wednesday, June 24, 2009

Service stuck in "stopping" state

A couple of days ago I wanted to restart the Windows SharePoint Services Timer service on one of our SharePoint servers because some timer jobs seemed to be stuck. When I tried this though, the state of the service became "stopping" and it stayed that way for hours. I tried stopping it with NET STOP, but this gave me an error that the service "could not be controlled in its current state". I read online that rebooting didn't help with most people and this also wasn't an option since this was a live server, but then I read about PsTools. This set of command line tools contains a little something called PsKill. This little tool kills the process for you, allowing you to start it again. In my case, I used it the following way:

PsKill.exe \\moss-server owstimer

This killed it immediately and I was able to start the service again.

You do have to be careful with this though, since not all services can be killed without any risk (for example when a process is writing things to a database).

One last thing, for your convenience: the link to PsTools: http://download.sysinternals.com/Files/PsTools.zip.

No comments: