How can I terminate a process that is launched from within an application programmatically? To clarify, there is an application that launches a WebKit subprocess from time to time, and I want to kill this subprocess shortly after it begins (i.e., not immediately, but after 3 seconds or so).
What I currently do is grep the output of
ps aux for WebKit and then either kill with the PID or killall the process binary, but this seems like something I should be able to automate. If I know the subprocess gets launched every 5 minutes, for example, what tools are available for to keep something running in the background to check for new instances of this subprocess and programmatically kill it? (BTW,
pgrep are not available to me.)