User names come from a database, but user IDs are whatever a process running setuid chooses. Could you clarify what this question was about in light of LarsWirzenius's comment? Also now I find that other than "kill", "pkill", "skill" etc are not available on my system.
OBDWIZ CUSTOM PID HOW TO
The source code for the pkill utility would, for example, show how to do that. Any ideas? Is there a dynamic mapping of the pids under UIDs in Linux? Isn't this in the proc? Do you want a tool to do this pkill, slay, others existor do you want to write it yourself? If the former, the superuser stack exchange site is probably better. The best answers are voted up and rise to the top. If you pass -1 as the process ID argument to either the kill shell command or the kill C functionthen the signal is sent to all the processes it can reach, which in practice means all the processes of the user running the kill command or syscall. To get list of users, use getpwent it will get one user per call.
If not, then 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? Subscribe to RSS I want to kill all running processes of a particular user from either a shell script or native code on a Linux system. By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.