@Override public boolean signalContainer(String user, String pid, Signal signal) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Sending signal " + signal.getValue() + " to pid " + pid + " as user " + user); } if (!containerIsAlive(pid)) { return false; } try { killContainer(pid, signal); } catch (IOException e) { if (!containerIsAlive(pid)) { return false; } throw e; } return true; }
Integer.toString(Commands.SIGNAL_CONTAINER.getValue()), pid, Integer.toString(signal.getValue()) }; ShellCommandExecutor shExec = new ShellCommandExecutor(command); if (LOG.isDebugEnabled()) {
Integer.toString(Commands.SIGNAL_CONTAINER.getValue()), pid, Integer.toString(signal.getValue()) }; ShellCommandExecutor shExec = new ShellCommandExecutor(command); if (LOG.isDebugEnabled()) {
.SIGNAL_CONTAINER.getValue()), ctx.getExecutionAttribute(PID), Integer.toString(ctx.getExecutionAttribute(SIGNAL).getValue())); privOp.disableFailureLogging(); try {
@Override public void signalContainer(ContainerRuntimeContext ctx) throws ContainerExecutionException { Container container = ctx.getContainer(); PrivilegedOperation signalOp = new PrivilegedOperation( PrivilegedOperation.OperationType.SIGNAL_CONTAINER); signalOp.appendArgs(ctx.getExecutionAttribute(RUN_AS_USER), ctx.getExecutionAttribute(USER), Integer.toString(PrivilegedOperation.RunAsUserCommand .SIGNAL_CONTAINER.getValue()), ctx.getExecutionAttribute(PID), Integer.toString(ctx.getExecutionAttribute(SIGNAL).getValue())); //Some failures here are acceptable. Let the calling executor decide. signalOp.disableFailureLogging(); try { PrivilegedOperationExecutor executor = PrivilegedOperationExecutor .getInstance(conf); executor.executePrivilegedOperation(null, signalOp, null, container.getLaunchContext().getEnvironment(), false, true); } catch (PrivilegedOperationException e) { //Don't log the failure here. Some kinds of signaling failures are // acceptable. Let the calling executor decide what to do. throw new ContainerExecutionException("Signal container failed", e .getExitCode(), e.getOutput(), e.getErrorOutput()); } }
@Override public void signalContainer(ContainerRuntimeContext ctx) throws ContainerExecutionException { PrivilegedOperation signalOp = new PrivilegedOperation( PrivilegedOperation.OperationType.SIGNAL_CONTAINER); signalOp.appendArgs(ctx.getExecutionAttribute(RUN_AS_USER), ctx.getExecutionAttribute(USER), Integer.toString(PrivilegedOperation.RunAsUserCommand .SIGNAL_CONTAINER.getValue()), ctx.getExecutionAttribute(PID), Integer.toString(ctx.getExecutionAttribute(SIGNAL).getValue())); //Some failures here are acceptable. Let the calling executor decide. signalOp.disableFailureLogging(); try { PrivilegedOperationExecutor executor = PrivilegedOperationExecutor .getInstance(conf); executor.executePrivilegedOperation(null, signalOp, null, null, false, false); } catch (PrivilegedOperationException e) { //Don't log the failure here. Some kinds of signaling failures are // acceptable. Let the calling executor decide what to do. throw new ContainerExecutionException("Signal container failed", e .getExitCode(), e.getOutput(), e.getErrorOutput()); } }
@Override public void signalContainer(ContainerRuntimeContext ctx) throws ContainerExecutionException { Container container = ctx.getContainer(); PrivilegedOperation signalOp = new PrivilegedOperation( PrivilegedOperation.OperationType.SIGNAL_CONTAINER); signalOp.appendArgs(ctx.getExecutionAttribute(RUN_AS_USER), ctx.getExecutionAttribute(USER), Integer.toString(PrivilegedOperation .RunAsUserCommand.SIGNAL_CONTAINER.getValue()), ctx.getExecutionAttribute(PID), Integer.toString(ctx.getExecutionAttribute(SIGNAL).getValue())); try { PrivilegedOperationExecutor executor = PrivilegedOperationExecutor .getInstance(conf); executor.executePrivilegedOperation(null, signalOp, null, container.getLaunchContext().getEnvironment(), false, true); } catch (PrivilegedOperationException e) { LOG.warn("Signal container failed. Exception: ", e); throw new ContainerExecutionException("Signal container failed", e .getExitCode(), e.getOutput(), e.getErrorOutput()); } }
@Override public boolean signalContainer(ContainerSignalContext ctx) throws IOException { String user = ctx.getUser(); String pid = ctx.getPid(); Signal signal = ctx.getSignal(); if (LOG.isDebugEnabled()) { LOG.debug("Sending signal " + signal.getValue() + " to pid " + pid + " as user " + user); } if (!containerIsAlive(pid)) { return false; } try { killContainer(pid, signal); } catch (IOException e) { if (!containerIsAlive(pid)) { return false; } throw e; } return true; }
@Override public boolean signalContainer(ContainerSignalContext ctx) throws IOException { String user = ctx.getUser(); String pid = ctx.getPid(); Signal signal = ctx.getSignal(); if (LOG.isDebugEnabled()) { LOG.debug("Sending signal " + signal.getValue() + " to pid " + pid + " as user " + user); } if (!containerIsAlive(pid)) { return false; } try { killContainer(pid, signal); } catch (IOException e) { if (!containerIsAlive(pid)) { return false; } throw e; } return true; }
@Override public boolean signalContainer(String user, String pid, Signal signal) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Sending signal " + signal.getValue() + " to pid " + pid + " as user " + user); } if (!containerIsAlive(pid)) { return false; } try { killContainer(pid, signal); } catch (IOException e) { if (!containerIsAlive(pid)) { return false; } throw e; } return true; }
@Override public boolean signalContainer(ContainerSignalContext ctx) throws IOException { String user = ctx.getUser(); String pid = ctx.getPid(); Signal signal = ctx.getSignal(); LOG.debug("Sending signal " + signal.getValue() + " to pid " + pid + " as user " + user); if (!containerIsAlive(pid)) { return false; } try { killContainer(pid, signal); } catch (IOException e) { if (!containerIsAlive(pid)) { return false; } throw e; } return true; }
@Override public boolean signalContainer(String user, String pid, Signal signal) throws IOException { LOG.debug("Sending signal " + signal.getValue() + " to pid " + pid + " as user " + user); if (!containerIsAlive(pid)) { return false; } try { killContainer(pid, signal); } catch (IOException e) { if (!containerIsAlive(pid)) { return false; } throw e; } return true; }
@Override public boolean signalContainer(String user, String pid, Signal signal) throws IOException { LOG.debug("Sending signal " + signal.getValue() + " to pid " + pid + " as user " + user); if (!containerIsAlive(pid)) { return false; } try { killContainer(pid, signal); } catch (IOException e) { if (!containerIsAlive(pid)) { return false; } throw e; } return true; }
/** * Send a specified signal to the specified pid * * @param pid the pid of the process [group] to signal. * @param signal signal to send * (for logging). */ protected void killContainer(String pid, Signal signal) throws IOException { new ShellCommandExecutor(Shell.getSignalKillCommand(signal.getValue(), pid)) .execute(); }
/** * Send a specified signal to the specified pid * * @param pid the pid of the process [group] to signal. * @param signal signal to send * @throws IOException if the command to kill the process fails */ protected void killContainer(String pid, Signal signal) throws IOException { new ShellCommandExecutor(Shell.getSignalKillCommand(signal.getValue(), pid)) .execute(); }
/** * Send a specified signal to the specified pid * * @param pid the pid of the process [group] to signal. * @param signal signal to send * (for logging). */ protected void killContainer(String pid, Signal signal) throws IOException { new ShellCommandExecutor(Shell.getSignalKillCommand(signal.getValue(), pid)) .execute(); }
/** * Send a specified signal to the specified pid * * @param pid the pid of the process [group] to signal. * @param signal signal to send * (for logging). */ protected void killContainer(String pid, Signal signal) throws IOException { new ShellCommandExecutor(Shell.getSignalKillCommand(signal.getValue(), pid)) .execute(); }
/** * Send a specified signal to the specified pid * * @param pid the pid of the process [group] to signal. * @param signal signal to send * (for logging). */ protected void killContainer(String pid, Signal signal) throws IOException { new ShellCommandExecutor(Shell.getSignalKillCommand(signal.getValue(), pid)) .execute(); }
/** * Send a specified signal to the specified pid * * @param pid the pid of the process [group] to signal. * @param signal signal to send * (for logging). */ protected void killContainer(String pid, Signal signal) throws IOException { new ShellCommandExecutor(Shell.getSignalKillCommand(signal.getValue(), pid)) .execute(); }
/** * Send a specified signal to the specified pid * * @param pid the pid of the process [group] to signal. * @param signal signal to send * (for logging). */ protected void killContainer(String pid, Signal signal) throws IOException { new ShellCommandExecutor(Shell.getSignalKillCommand(signal.getValue(), pid)) .execute(); }