add how to get the pid of a running process, reliably.