Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

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

share|improve this answer
    
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? –  Joerg Jun 13 '13 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 '13 at 13:51

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.

share|improve this answer
    
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...) –  Joerg Jun 13 '13 at 9:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.