Operating System - HP-UX
1833776 Members
2317 Online
110063 Solutions
New Discussion

Command needed to check the Parent process and assiciated process.

 
Saraswathy_1
Advisor

Command needed to check the Parent process and assiciated process.

Hey I have problem to investigate issues related to Process.
My each application starts a java process.There would be around 1000 applications and 1000 java processes.
When one particulat java process stucks its very tedious for me to isolate the java process.
I always use ps -fu | sort -nk2.
and ps -fu |sort -n

Still Iam not happy with these two commands.
Iam looking for command which shows the exactly the parent process first then child.
Just eg:

sar 837 1 0 01:26:02 ? 0:00 /bin/sh ./start fe2ps1_16 http://15.1.26.49:
sar 864 837 0 01:26:03 ? 27:09 /opt/bea/jdk131_08/bin/../bin/PA_RISC2.0/native_threads/java -X
sar 948 1 0 02:20:03 ? 0:00 /bin/sh ./start fe2ps1_34 http://15.1.26.49:7
sar 964 948 0 02:20:04 ? 28:49 /opt/bea/jdk131_08/bin/../bin/PA_RISC2.0/native_threads/java -X

This is how Iam expecting. Please provide the exact command.

~Thanks
Saras
2 REPLIES 2
Keith Bryson
Honored Contributor

Re: Command needed to check the Parent process and assiciated process.

Hi there

Hope this helps - Try the WHOLE of this command and just substitute user_id for your user:

UNIX95= ps -fxH -u user_id -o pid,ppid,cpu,stime,tty,time,comm | more

This will show the process listing for the user, with child processes listed under each parent process. Additionally, if each child process also has their own process(es), these are also given - the output is tabulated so that you can see the process tree.

Let us know how you get on - Keith
Arse-cover at all costs
Robert-Jan Goossens
Honored Contributor

Re: Command needed to check the Parent process and assiciated process.

Saras,

Something like

# UNIX95= ps -efH

# UNIX95=true ps -AH -o user,pid,args

# ps -ef | grep "syslogd" | awk ' { printf "Process id = %s Parent Process id = %s\n", $2, $3 }'

Best regards,
Robert-Jan