I recently was bitten by an oddity with pkill, and I wonder if
people would consider it a bug:
While trying to restart sshd on a remote server, I issued the
5388 ptree 5378
$ pgrep -P 1 sshd
$ su root -c 'pkill -9 -P 1 sshd'
and at this point, I got logged off.
Here's what I think happens: if pkill find the parent before
it finds the child, it kills the parent first. This makes the
child an orphan, and when it is examined later, it ...