Linux: Process Details With PS

A lot of IBM based software run listeners with a common name.  Occasionally, one of these listeners will hang and that individual process killed and restarted.  In the case below, IBM Websphere was running with a generic named “java” listener.  Instead of just killing the process, I needed to know what it actually was,

A typical ps just shows the user and the process called ‘java’
[server1 ~]# ps -auxc | grep java
tstuser   7005  4.0  8.4 476516 329140 ?       Sl   11:33   4:04 java

Needed more details.  The following returns the full path to the application, but cuts off all the rest of the data
[server1 ~]# ps -ef

tstuser 7005 1 3 11:33 ? 00:04:10 /app/IBM/WebSphere/AppServer/java/bin/java -Dwas.status.socket=1893
root 8722 8701 0 13:13 pts/0 00:00:00 su -
root 8725 8722 0 13:13 pts/0 00:00:00 -bash
root 8895 8725 0 13:19 pts/0 00:00:00 ps -ef

Here is the full output of ‘ps -ef’ using grep to only return the process I was looking for (PID 70005) that was found in the above ps -ef example.
[server1 ~]# ps -ef | grep 7005
tstuser   7005     1  3 11:33 ?        00:04:14 /app/IBM/WebSphere/AppServer/java/bin/java -Dosgi.install.area=/opt/IBM/WebSphere/AppServer -Dosgi.configuration.area=/opt/IBM/hub-simple/wasND/Profiles/profile/configuration -Djava.awt.headless=true -Dosgi.framework.extensions=com.x.cds -Xscmx50M -Xbootclasspath/p:/opt/IBM/WebSphere/AppServer/java/jre/lib/ext/ibmorb.ja server1

I removed about 10 more lines from the full argument output, but you can still see alot the arguments that were passed to the java executable when it was started.

Note:  There are definitely more ways of doing the same thing in Linux, but this is the first I always come to.

About these ads

~ by Kevin Goodman on December 1, 2008.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 1,372 other followers

%d bloggers like this: