Wednesday, 18 May 2011

How to Find and Stop a Stuck Process in Solaris

Sometimes an application in Solaris gets stuck when it does not exit properly. For example, you exit a GUI application in Solaris. When you try to start the application, nothing happens. The application was just working. What the heck?



Typically this is a symptom of an application that did not exit properly and is still running. So how do I find the application and stop it? Here's how.



(1) To look at all the running processes on Solaris use this command:

ps -ef



This gives you a big list of all running applications. However, we can make things a lot easier. Let us say firefox did not exit cleanly.



So to search just for firefox processes, use grep. For example:

ps -ef | grep firefox



This will show all the running firefox processes. Note the process number for each process. For example, process 5555 is stuck.



To stop it, use the kill command:

kill -9 5555



Repeat the kill command as necessary if there are other stuck processes.



To make sure the stuck process has been removed use ps with grep again.

ps -ef | grep firefox



There should only be a listing for your grep command line.



That's it.

No comments:

Post a Comment