How to get the PID of process and send signals