public function stopProgram($programName)
{
// what are we doing?
$log = usingLog()->startAction("stop program '{$programName}' on host '{$this->args[0]}'");
// get the host details
$hostDetails = $this->getHostDetails();
// stop the program
$result = usingHost($hostDetails->hostId)->runCommand("sudo supervisorctl stop '{$programName}'");
// did the command succeed?
if ($result->didCommandFail()) {
throw new E5xx_ActionFailed(__METHOD__, "failed to start process '{$programName} (via supervisord)'");
}
// all done
$log->endAction();
return true;
}