@Override
  public void shellExec(final RpcController controller, final ShellExecRequest request,
    final RpcCallback<ShellExecResponse> done) {
    final String command = request.getCommand();
    if (StringUtils.isBlank(command)) {
      throw new RuntimeException("Request contained an empty command.");
    }
    final boolean awaitResponse = !request.hasAwaitResponse() || request.getAwaitResponse();
    final String[] subShellCmd = new String[] { "/usr/bin/env", "bash", "-c", command };
    final Shell.ShellCommandExecutor shell = new Shell.ShellCommandExecutor(subShellCmd);

    final String msgFmt =
      "Executing command" + (!awaitResponse ? " on a background thread" : "") + ": {}";
    LOG.info(msgFmt, command);

    if (awaitResponse) {
      runForegroundTask(shell, controller, done);
    } else {
      runBackgroundTask(shell, done);
    }
  }
Receives shell commands from the client and executes them blindly. Intended only for use by
{@link ChaosMonkey} via {@link CoprocClusterManager}
hbase-it/src/test/java/org/apache/hadoop/hbase/ShellExecEndpointCoprocessor.java