The best uses I've found for the SIGSTOP and SIGCONT signals are times when a process goes haywire, or when a script spawns too many processes at once.
You can issue the signals like this:
kill -SIGSTOP [pid] kill -SIGCONT [pid]
Wikipedia has great definitions for SIGSTOP:
When SIGSTOP is sent to a process, the usual behaviour is to pause that process in its current state. The process will only resume execution if it is sent the SIGCONT signal. SIGSTOP and SIGCONT are used for job control in the Unix shell, among other purposes. SIGSTOP cannot be caught or ignored.
and SIGCONT:
When SIGSTOP or SIGTSTP is sent to a process, the usual behaviour is to pause that process in its current state. The process will only resume execution if it is sent the SIGCONT signal. SIGSTOP and SIGCONT are used for job control in the Unix shell, among other purposes.
In short, SIGSTOP tells a process to "hold on" and SIGCONT tells a process to "pick up where you left off". This can work really well for rsync jobs since you can pause the job, clear up some space on the destination device, and then resume the job. The source rsync process just thinks that the destination rsync process is taking a long time to respond.
In the ps output, stopped processes will have a status containing T. Here's an example with crond:
# kill -SIGSTOP `pgrep crond` # ps aufx | grep crond root 3499 0.0 0.0 100328 1236 ? Ts Jun11 0:01 crond # kill -SIGCONT `pgrep crond` # ps aufx | grep crond root 3499 0.0 0.0 100328 1236 ? Ss Jun11 0:01 crond












We had a similar problem when someone wrote C code to fork processes but due to some some bug it kept on creating processes.
To stop the main process in its track, we had to login as the user as issue "kill -9 -1"
I guess SIGSTOP would have helped.
These commands could be implemented into an easy to make easy to use and hopefully useful bash script.
For those too lazy or who want to make it easy in case they forget the exact command (somehow)
I think too much but whatever.
-Kyle G
SIGCONT (kill -18 on Linux) is good for killing the dreaded zombie processes that just won't die