0

I have 2 eclipse and 2 servers running If i make a ps -C java i see something like:

 2460 pts/1    00:03:08 java
 2908 pts/3    00:00:05 java
 3045 pts/4    00:00:17 java
 3284 pts/3    00:01:40 java

is it possible to start it somehow that i see something like:

 2460 pts/1    00:03:08 java-eclipse1
 2908 pts/3    00:00:05 java-eclipse2
 3045 pts/4    00:00:17 java-server1
 3284 pts/3    00:01:40 java-server2

so i know, which process i have to kill if something went wrong?

Thanks in advance

Jörg

2 Answers 2

1

Try

ps -C java -o pid -o ppid -o cmd

that will give you the pid and parent pid of the java processes along with the command line arguments that will tell you which are the child processes and hopefully the arguments will let you identify which is eclipse.

Another alternative is to use

pstree -as <pid> 

to get the process tree of the java process and arguments.

P.S. My eclipse process shows up as eclipse not java

2
  • how you start your eclipse ? i always start it with /{yourpath}/eclipse/eclipse and yes, your shell stuff helps a little bit, but it is not possible to give a process an own name?
    – Joergi
    Jun 13, 2013 at 13:24
  • 1
    Java is the process's name. all java code runs in the java virtual machine. At work they've sort of got round it by putting -DFRED (FRED identifies the process) as the first parameter to the JVM, so you can find the process by listing the processes with arguments
    – parkydr
    Jun 13, 2013 at 13:51
0

choose any process and it's parent so that you know which java belongs to which Eclipse.

Then give kill STOP signal to the eclipse and it'll stop responding. Then give START signal and it'll be back to normal. This is how you can identify the exact process.

1
  • hmmm that's not what I really want - i want to start it with a different process name, if possible (and i don't know which one is parent of what...)
    – Joergi
    Jun 13, 2013 at 9:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .