I have the following code on a PHP page, which executes a node command for me.
<?php
if (isset($_POST['button'])) { exec('/usr/local/bin/node DroneNotes/Dronestream/server.js'); } ?>
<form method="POST">
<p>
<input type="hidden" name="button" value="1">
<input type="submit" value="Start Video">
</p>
</form>
The command is executing fine for me but the process is just hanging and not stopping for me. Im wondering could I kill the process in some way by creating another button click or can something be added in to end it after a certain time?