I want to know why after disowning the stopped process, it is still appearing the process table

PING www.google.com ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=44 time=182 ms
64 bytes from icmp_seq=2 ttl=44 time=209 ms
64 bytes from icmp_seq=3 ttl=44 time=213 ms
64 bytes from icmp_seq=4 ttl=44 time=122 ms
[1]+  Stopped                 ping www.google.com
anshul@anshul-Inspiron-N5010:~/Documents/workspace/shell$ jobs -l
[1]+ 10319 Stopped                 ping www.google.com
anshul@anshul-Inspiron-N5010:~/Documents/workspace/shell$ disown
bash: warning: deleting stopped job 1 with process group 10319
anshul@anshul-Inspiron-N5010:~/Documents/workspace/shell$ ps -ef | grep 10319
anshul   10319  9717  0 23:35 pts/25   00:00:00 ping www.google.com

Why still the process 10319 is showing, it should be deleted, right?


No, the process is stopped, not killed. So ps will still show it.

If you run ps ax, you will see its status is T. In this state, the process will do nothing until it receives a SIGCONT, then it will continue to run (if you type fg in your terminal, you'll see the process starting again from the point it stopped, so in your case the next icmp_seq will be 5).

EDIT: I forgot the disown part. Since you disowned the process, it doesn't appear anymore in jobs. For this reason, you can't fg it. However it is still present in the ps output with the T status. So as you said, you are still able to CONTINUE it with a kill -sigcont <PID>. Nevertheless, even you sent a SIGCONT, you can't un-disown it, that means you won't be able to make it run back in foreground of your terminal.

  • Thanks for the answer, I was unable to resume with fg, but was able to resume with kill -CONT <pid> – Anveshak Apr 22 '15 at 18:33
  • @Anveshak Yes, my bad. I totally forgot the disown part... In this case, you are right, running fg won't work, nevertheless the process still appear in ps. Anyway, you found the kill -CONT :) My apologies... – apaul Apr 22 '15 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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