String cmd = "ps aux | grep " + ttyName + " | grep -v \"grep\" | awk '{print $2}' | sudo xargs kill -9";
SSHUtil sshUtil = new SSHUtil();
//if refresh failed, user still can manually refresh tty by Ctrl+C, so don't need to check whether
//it succeed or not
try {
boolean refreshTtySucceed = sshUtil.execCmd(sshUser, privateKeyFile, nodeIP, sshPort, cmd, null, null);
logger.info("Refresh " + ttyName + " on " + nodeIP + (refreshTtySucceed ? "succeed" : "failed") + ".");
} catch (JSchException e) {
logger.error("Got exception when refresh tty on " + nodeIP, e);
}
}