As
cracauer@ already mentioned, the key thing is to send the signal to the process group, rather than to a single process.
Just want to suggest an another way of doing this: a
kill(1) utility can send a signal to the all processes in the group. It is done via specifying -
PGID as pid argument, where PGID is a process group id. You can retrieve it using
j option for
ps(1):
ps jax will print the PGID in the 4th column. So, bringing all that together, (let's assume your process group id is
4997)
kill -STOP -- -4997 should do the thing. Notice this
-- double dash before specifying
-4997. Without that, shell will treat
4997 as an option, whereas we, in fact, want the shell to treat the whole
-4997 (with leading minus) as an option.
Artem