public static void execute(String[] args, Configuration conf) {
    LOG.info("arguments : " + Arrays.toString(args));

    try {
      CommandLine cmdline = new GnuParser().parse(getOptions(), args);
      if (cmdline.hasOption(ChaosServiceName.CHAOSAGENT.toString().toLowerCase())) {
        String actionStr =
          cmdline.getOptionValue(ChaosServiceName.CHAOSAGENT.toString().toLowerCase());
        try {
          ExecutorAction action = ExecutorAction.valueOf(actionStr.toUpperCase());
          if (action == ExecutorAction.START) {
            ChaosServiceStart(conf, ChaosServiceName.CHAOSAGENT);
          } else if (action == ExecutorAction.STOP) {
            ChaosServiceStop();
          }
        } catch (IllegalArgumentException e) {
          LOG.error("action passed: {} Unexpected action. Please provide only start/stop.",
            actionStr, e);
          throw new RuntimeException(e);
        }
      } else {
        LOG.error("Invalid Options");
      }
    } catch (Exception e) {
      LOG.error("Error while starting ChaosService : ", e);
    }
  }
Class used to start/stop Chaos related services (currently chaosagent)
hbase-it/src/main/java/org/apache/hadoop/hbase/chaos/ChaosService.java