I'm invoking some PHP backend scripts on Apache webserver that are programmed to run for a few days. The trouble is that I cannot figure out a way to stop these scripts (except restarting the server using sudo apachectl restart).
Normally I would run
ps -aux | grep script_name get the PID and kill it.
But in this case when I do this using PHP (
shell_exec("ps -aux | grep script_name") I do not see the process.. my hypothesis is that when invoking the scripts via apache it runs them internally, so they are not visible.
Any ideas how to check which scripts are running and abort these when needed?