Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have written a program in the Eclipse environment. First I execute it from Eclipse. After that from the terminal window I view the list of my processes. Now I execute that program from command line and view the list of processes.

I see the process is listed with different states: when the program is executed from Eclipse the state is S, when the program is executed from the terminal, the state is S+.

What is the reason?

share|improve this question
    
For example the same running process is in different states –  XXXX Oct 8 '13 at 20:37
    
Please provide example output. –  moon.musick Oct 8 '13 at 20:53
    
For example when the program is executed from Eclipse the state is S, when the program is executed from terminal, the state is S+. –  XXXX Oct 8 '13 at 21:04
    
I mean the process state –  XXXX Oct 8 '13 at 21:04
    
Welcome to AskUbuntu! The best way to add additional information to your question is by editing it, with the edit button. It is better visible that way, and comments are mainly for secondary, temporary purposes. Comments are removed under a variety of circumstances. Anything important to your question should be in the question itself. –  zwets Oct 8 '13 at 21:30

1 Answer 1

When you run the process in a terminal, its process state is marked with a + because it is the foreground process in that terminal. This means, among other things, that the terminal can be used to control the process. For instance, pressing Ctrl-C will result in an SIGINT signal being sent to the process. Depending on the signal handlers in the program, this will usually terminate the process. Also, closing the terminal will send a a SIGHUP* signal to the process.

When you run the process from Eclipse, the + is not there because the process is not in the foreground process group of any terminal. In fact, unless you have started Eclipse from a terminal (and not backgrounded it with & or ^Z), Eclipse itself will not have a controlling terminal, and so will none of its child processes.


*) HUP for "hang up", from the days when terminals were physical machines that connected to computers over serial dial-up lines

share|improve this answer

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.