zeldor.biz

Linux, programming and more

Copyright © 2023
Log in

Two great signals

February 4, 2011 by Igor Drobot Leave a Comment

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.

Usage Examples for both signals:

1
2
kill -SIGSTOP [pid]
kill -SIGCONT [pid]

kill -SIGSTOP [pid] kill -SIGCONT [pid]


Wikipedias great definition 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 for 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 PID to “hold on” and SIGCONT tells a process to “pick up where you left off”.

This work very well if one process needs a lot of memory and you need this memory now – you can pause a process and continue it.

Filed Under: Bash, Debian, Linux Tagged With: kill, sigcon, sogstop

Categories

Archives

Tags

apache2 Apple arduino ARM Automation backup bash Cisco Cluster Corosync Database Debian Debian squeeze DIY DNS Fedora FTP Fun Icinga Ipv6 KVM Linux LVM MAC OS X Monitoring MySQL Nagios Nginx openSUSE OpenVPN PHP Proxy Python python3 qemu RAID rsync Samba security ssh Ubuntu virtualization Windows Windows 7 Wordpress

Leave a Reply

Your email address will not be published. Required fields are marked *