Examples of ProcessExecution


Examples of org.rhq.core.system.ProcessExecution

            String msg = "yum executable: not-found";
            log.error(msg);
            throw new Exception(msg);
        }

        ProcessExecution installPackages = new ProcessExecution(yum);
        installPackages.setArguments(args);
        installPackages.setCaptureOutput(true);
        installPackages.setWaitForCompletion(1000L * 60 * 30); // wait for it to finish in 30mins
        ProcessExecutionResults result = this.resourceContext.getSystemInformation().executeProcess(installPackages);
        String output = result.getCapturedOutput();
        Integer exitCode = result.getExitCode();
        log.info("yum result: " + exitCode + "\n" + output);
        if ((output == null) && ((exitCode == null) || (result.getExitCode() != 0))) {
View Full Code Here

Examples of org.rhq.core.system.ProcessExecution

        // Continue with generic operations
        Operation operation = getOperation(name);
        File controlScriptPath = this.serverComponent.getControlScriptPath();
        validateScriptFile(controlScriptPath);
        ProcessExecution processExecution = ProcessExecutionUtility.createProcessExecution(controlScriptPath);
        processExecution.setWaitForCompletion(1000 * 30); // 30 seconds - should be plenty
        processExecution.setCaptureOutput(true); // essential, since we want to include the output in the result

        addDefaultArguments(processExecution);

        //we always add some arguments to the control script thus forcing the passthrough mode.
        //therefore no matter if we use httpd, Apache.exe or apachectl, the -k argument will always
        //be used to specify the operation to invoke.
        if (operation != Operation.CONFIG_TEST) {
            processExecution.getArguments().add("-k");
        }

        // request an avail check after a lifecycle operation
        boolean availCheck = true;

        switch (operation) {
        case START: {
            processExecution.getArguments().add("start");
            break;
        }

        case STOP: {
            processExecution.getArguments().add("stop");
            break;
        }

        case RESTART: {
            abortIfOsIsWindows(name);
            processExecution.getArguments().add("restart");
            break;
        }

        case START_SSL: {
            abortIfOsIsWindows(name);
            processExecution.getArguments().add("startssl");
            break;
        }

        case GRACEFUL_RESTART: {
            processExecution.getArguments().add((osIsWindows()) ? "restart" : "graceful");
            break;
        }

        case CONFIG_TEST: {
            // abortIfOsIsWindows(name);
            processExecution.getArguments().add("-t");
            availCheck = false;
            break;
        }

        default:
View Full Code Here

Examples of tcg.common.util.ProcessExecution

            + "--logfile " + logfile + " "
            + process.config.arguments;
            //+ "&";
     
      //start the execution on its own thread.
      ProcessExecution exec = new ProcessExecution(cmd);
      exec.start();

      //store the execution context
      process.instance = exec;
     
//      //NOTE: maybe it is cleaner to just use a native call to fork out a process.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.