I would like to use PHP to kill a process initiated by a LaunchDaemon.
I have my script, I'm grabbing and storing the pid - using getmypid() - using a table, and then referring back to that to kill the process, but I'm stuck because:
exec('sudo kill 12345');
won't work.
Is it possible to use sudo in php exec? Are there any other ways to kill a process using PHP that doesn't use the proc funcctions, or would proc_terminate and proc_open be something I should look into?
I have seen this - there is no answer so maybe it is not possible: here