this question is a follow-up to: How to suspend and resume processes
I have started firefox from a bash session in gnome-terminal.
The process tree looks like this:
$ ps -e -o pid,ppid,cmd -H
1828 1 gnome-terminal
26677 1828 bash
27980 26677 /bin/sh /usr/lib/firefox-3.6.15/firefox
27985 27980 /bin/sh /usr/lib/firefox-3.6.15/run-mozilla.sh /usr/lib/firefox-3.6.15/firefox-bin
27989 27985 /usr/lib/firefox-3.6.15/firefox-bin
28012 27989 /usr/lib/firefox-3.6.15/plugin-container /usr/lib/adobe-flashplugin/libflashplayer.so 27989 plugin true
When I hit CTRL+Z
in bash, it will suspend firefox. When I issue the command bg
(or fg
) it will resume firefox. This is as expected.
When I issue the command kill -s SIGTSTP 27980
in another terminal, it will print the line [1]+ Stopped firefox
in the first terminal (just like when i hit CTRL+Z
), but it does not suspend firefox. I asume it only suspends the shell script.
When I issue the command kill -s SIGTSTP 27989
(note the PID) in another terminal, it will suspend firefox. The first terminal does not take note of this.
How does bash suspend the entire process tree? does it just traverse the tree and SIGTSTP all of the children?
pgid
to yourps
command to see the process groups @geekosaur is talking about. – ninjalj Mar 17 '11 at 22:54