public static boolean startLinuxProcess()

in shardingsphere-benchmark/src/main/java/org/apache/shardingsphere/benchmark/common/file/util/ProcessUtil.java [31:59]


    public static boolean startLinuxProcess(String shScriptPath){
    
        String line = "";
        Process process = null;
        BufferedReader input = null;
        try {
            String[] cmd = {"/bin/sh", "-c", shScriptPath};
            process = Runtime.getRuntime().exec(cmd);
            input = new BufferedReader(new InputStreamReader(process.getInputStream()));
            StringBuffer sb = new StringBuffer("");
            while ((line = input.readLine()) != null) {
                sb.append(line).append("\r\n");
            }
            if(process != null){
                int extValue = process.waitFor(); 
                if(0 == extValue){
                    return true;
                }
            }
            return false;
        } catch (Exception e) {
            return false;
        } finally {
            try {
                input.close();
                process.destroy();
            } catch (Exception e) {}
        }
    }