DavidYahalom.com is an IT knowledgebase dedicated to the world of databses and RDBMS systems by David Yahalom. Here you'll find articles, views, news, tips and in-depth analysis about Oracle, DB2 LUW, Sql Server and MySql. I hope you'll enjoy your stay.
31st
JUL
Show full process name / path / string in Solaris using ps
Posted by David Yahalom under Solaris
Let’s say you have a JAVA process running on an old Sun Solaris machine. You want to see the full path of the process running including any run-time variables that were passed to it.
Using ps -eaf | grep -i java gives us this:
[root@hostname ~]# which ps /bin/ps [root@hostname ~]# ps -eaf | grep -i java nobody 4589 4588 0 14:26:35 ? 0:21 /usr/java1.4/bin/java -Djava.awt.headless=true -Xms200m -Xmx300m org.apache.jse
As you can see the process name is trimmed and you can’t see all parameters passed to Java. No matter what parameters or scripting you’ll try and do, using /bin/ps (default) will crop your process name.
There is, however, an entriely different ps program we can use.
[root@hostname ~]#/usr/ucb/ps -auxwww | grep -i java nobody 4589 0.1 4.228480842528 ? S 14:26:35 0:21 /usr/java1.4/bin/java -Djava.awt.headless=true -Xms200m -Xmx300m org.apache.jserv.JServ /jserv/etc/jserv.properties
Fantastic!
Reader's Comments
Leave a Reply
Post Meta
-
July 31, 2008 -
Solaris -
3 Comments
-
Comments Feed
DavidYahalom.com - Oracle, Databases, SQL, news, views, articles and in-depth analysis is powered by Wordpress. Designed by Free WordPress Themes.

[…] - Show full process name / path / string in Solaris using ps saved by xmcrxangelx2008-09-14 - Yay for Zones! saved by veerenmaristeam32008-08-25 - Installing […]
Well, that just saved my ass, so thanks a lot!
/usr/ucb/ps also truncates the command lines it displays, though its limit is longer than that of /usr/bin/ps.
The only ready-made way I know of to display a process’s command line arguments from a shell under Solaris is the program ‘pargs’.
Neither version of ‘ps’ shipped with Solaris reports to you that it has truncated its output when it does so.
The manpages say that ‘ps’ displays the process command line, but it does not always do this. So the doco is wrong.
Worse, when ps truncates its output, yielding potentially plausible but certainly false command lines, it doesn’t tell you that it’s lying to you!
Silent failures are the worst kind.
I haven’t observed the same failure under Linux using the procps tools.