We are writing a daemon to do something similar to what jamf's restricted software feature does. We want to specify apps that students cannot use while on campus, but are allowed to use at home (on-campus means on our network). We were planning to do something like this
ps -acx | grep "$process"
but I ran across this:
http://mywiki.wooledge.org/ProcessManagement#How_do_I_kill_a_process_by_name.3F__I_need_to_get_the_PID_out_of_ps_aux_.7C_grep_....
that suggests this is a bad idea. In our testing we haven't run into any of these problems, but if there is a better way to do this, it would be helpful.
Does anyone know how the jamf binary kills processes? Is it possible to use the jamf binary to kill a process?
