public boolean stopApp() { try { shell.doCommon("sudo -u admin " + binPath + " stop"); } catch (Exception e) { e.printStackTrace(); return false; } return true; }
public boolean startApp() { try { shell.doCommon("" + binPath + " restart"); } catch (Exception e) { e.printStackTrace(); return false; } return true; }
public boolean checkProcess() throws IOException { String ps = "ps -e -o lstart,cmd |grep -w java|grep -v grep|grep 'jboss.server.home.dir\\=/home/admin/\\w*/.default'"; String str = shell.doCommon(ps); if (str == null) { return false; } if (str.indexOf("/opt/taobao/java/bin/java") < 0) { return false; } return true; }