View Single Post
  #8   (View Single Post)  
Old 10th July 2008
Meta_Ridley Meta_Ridley is offline
OFM Addict
 
Join Date: May 2008
Posts: 21
Default

Quote:
Originally Posted by TerryP View Post
Wouldn't it be cool if you wanted to kill a process by PID, and could just rm -rf /proc/PID ? Or what if you wanted to find out it's name and arguments, how about cat /proc/cmdline.
I know this is getting into implementation and practice, but I thought this would be helpful: that command doesn't work on NetBSD's proc filesystem. Instead you can send a signal to /proc/[pid]/ctl like this:
Code:
echo term > /proc/[pid]/ctl
You can also send "attach," "detach," "run," "step," and "wait" to it, in addition to the usual process signals, and it will do all of those things.

Of course the mount_procfs(8) man page has all the info you need to find out what each file does in /proc.
Reply With Quote