Is there a way to determine if a Linux PID is paused or not?
I have a python script that is using the SIGSTOP and .SIGCONT commands with os.kill to pause or resume a process. Is there a way to determine whether the related PID is in the paused or resumed state? You can find information about a process from its /proc directory ( /proc/<PID> ). Specifically, you can find its run state with this python expression: open(os.path.join('/proc', str(pid), 'stat')).readline().split()[2]=='T' EDIT: This next expression fixes a (presumably rare) bug with the original: re.sub(r'\(.*\)', '()', open(os.path.join('/proc', str(pid), 'stat')).readline()).split()[2]=='T'