Just wondering about the difference between SIGSTOP
and SIGTSTP
signals.
The SIGSTOP signal stops the process. It cannot be handled, ignored, or blocked. The SIGTSTP signal is an interactive stop signal. Unlike SIGSTOP , this signal can be handled and ignored.
The SIGKILL signal is used to abort a process, and the SIGSTOP signal is used to pause a process. The SIGTERM signal is the default signal sent to processes by commands such as kill and pkill when no signal is specified.
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.
A good method to play with SIGSTOP and SIGCONT is to try the “xeyes” program which is available on most Linux distributions. It shows a couple of eyes that follow your mouse cursor. Once you pause the “xeyes” process you'll notice that the eyes won't follow you anymore…
Both signals are designed to suspend a process which will be eventually resumed with SIGCONT
. The main differences between them are:
SIGSTOP
is a signal sent programmatically (eg: kill -STOP pid
) while SIGTSTP
(for signal - terminal stop) may also be sent through the tty
driver by a user typing on a keyboard, usually Control-Z.
SIGSTOP
cannot be ignored. SIGTSTP
might be.
According with the /usr/include/x86_64-linux-gnu/bits/signum.h
file exists the following:
#define SIGSTOP 19 /* Stop, unblockable (POSIX). */
#define SIGTSTP 20 /* Keyboard stop (POSIX). */
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With