Another interesting procps bug. If you try to match a process by tty, you may get more than you expect.
This is because the match is done by device ID. If you have a mount namespace, this can mean you have more than one, say /dev/pts/0 so if you run pgrep on that tty, it might show processes within containers.
One fix is to check you are in the same mount namespace, but means if you do start a docker process and run ps it won;t show up.
#procps #programming