I want to kill all running processes of a particular user from either a shell script or native code on a linux system.
Do I have to read the /proc directory and look for these?
Any ideas? Is there a dynamic mapping of the pids under UIDs in linux? Isnt this in the proc?
If no where is this list maintained. Should I read from it? Also where is the static list of all UIDs in the system so I can validate this this user exists and then proceed to kill all processes running under it?
setuid()chooses. – Gilles Aug 4 '11 at 17:04