1

After I sent a kill SIGSTOP signal to another process, how can I check if that process actually stopped?

That process is not a child process. And not to use the approach that reads the process table like,

ps -ef/aux
Arnab Nandy
  • 6,472
  • 5
  • 44
  • 50
WindChaser
  • 960
  • 1
  • 10
  • 30

1 Answers1

0

You can see that in the directory /proc.

consider process id 17858. You are sending the signal SIGSTOP to that process. Now the process is stopped. In /proc , 17858( name of directory is process ID). directory is there. In that, status file is available. Using that one we can get the status of the file. For that process is status is like this.

State:  T (stopped)
Karthikeyan.R.S
  • 3,991
  • 1
  • 19
  • 31
  • I imagine that this can be combined with [inotifywait](https://linux.die.net/man/1/inotifywait) if you want to avoid polling. This approach does feel a little crazy though: using the the kernels asynchronous event api on its own metadata filesystem but I guess this is a nice generic way of getting events about state change from the kernel! – Att Righ Jun 30 '17 at 12:50
  • Hmm, alas, it looks like we get no inotify events when `/proc/$PID/status` changes. – Att Righ Jun 30 '17 at 14:55