// KillUnit takes the unit name and a UNIX signal number to send.  All of the unit's
// processes are killed.
9911
func (c *Conn) KillUnit(name string, signal int32) {
	c.sysobj.Call("org.freedesktop.systemd1.Manager.KillUnit", 0, name, "all", signal).Store()
}
1090468
func (c *Container) Kill() error {
	dc, err := getDockerClient()
	if err != nil {
		return err
	}
	return dc.KillContainer(dockerclient.KillContainerOptions{ID: c.ID, Signal: dockerclient.SIGKILL})
}
978303
func (c *Client) killed() bool {
	c.l.Lock()
	defer c.l.Unlock()
	return c.processKilled
}
1168824
func (s *AttackProperty) SetUnit(v string) *AttackProperty {
	s.Unit = &v
	return s
}
808229
func (s *PutMetricAlarmInput) SetUnit(v string) *PutMetricAlarmInput {
	s.Unit = &v
	return s
}
498165
func (h *taskHandle) Kill(killTimeout time.Duration, signal os.Signal) error {
	// Only send signal if killTimeout is set, otherwise stop container
	if killTimeout > 0 {
		if err := h.Signal(signal); err != nil {
			// Container has already been removed.
			if strings.Contains(err.Error(), NoSuchContainerError) {
				h.logger.Debug("attempted to signal nonexistent container")
				return nil
			}
			// Container has already been stopped.
			if strings.Contains(err.Error(), ContainerNotRunningError) {
				h.logger.Debug("attempted to signal a not-running container")
				return nil
			}

			h.logger.Error("failed to signal container while killing", "error", err)
			return fmt.Errorf("Failed to signal container %q while killing: %v", h.containerID, err)
		}

		select {
		case <-h.waitCh:
			return nil
		case <-time.After(killTimeout):
		}
	}

	// Stop the container
	err := h.client.StopContainer(h.containerID, 0)
	if err != nil {

		// Container has already been removed.
		if strings.Contains(err.Error(), NoSuchContainerError) {
			h.logger.Debug("attempted to stop nonexistent container")
			return nil
		}
		// Container has already been stopped.
		if strings.Contains(err.Error(), ContainerNotRunningError) {
			h.logger.Debug("attempted to stop an not-running container")
			return nil
		}

		h.logger.Error("failed to stop container", "error", err)
		return fmt.Errorf("Failed to stop container %s: %s", h.containerID, err)
	}

	h.logger.Info("stopped container")
	return nil
}
244132
func (w *stringsWatcherBase) Kill() {
	w.mu.Lock()
	defer w.mu.Unlock()

	if w.closed {
		return
	}

	w.closed = true
	close(w.changes)
	w.tomb.Kill(nil)
}
234914
func (pid *PID) Kill() error {
	proc, err := pid.Process()
	if err != nil {
		return err
	}

	return proc.Kill()
}
482289
func (mr *MockStringsWatcherMockRecorder) Kill() *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Kill", reflect.TypeOf((*MockStringsWatcher)(nil).Kill))
}
610509
func (k *KubeletExecutor) Kill(containerIDs []string) error {
	for _, containerID := range containerIDs {
		err := k.cli.KillGracefully(containerID)
		if err != nil {
			return err
		}
	}
	return nil
}
630768
func (s *MetricStat) SetUnit(v string) *MetricStat {
	s.Unit = &v
	return s
}
550966
func (s *MetricValue) SetUnit(v string) *MetricValue {
	s.Unit = &v
	return s
}
698237
func (s *MetricDatum) SetUnit(v string) *MetricDatum {
	s.Unit = &v
	return s
}
989650
func (s *service) Kill(ctx context.Context, r *taskAPI.KillRequest) (*ptypes.Empty, error) {
	return nil, errdefs.ErrNotImplemented
}
905247
func (r *RuneBuffer) Kill() {
	newlineIdx := strings.IndexRune(string(r.buf[r.idx:]), '\n')
	if newlineIdx < 0 {
		r.buf = r.buf[:r.idx]
	} else {
		r.buf = append(r.buf[:r.idx], r.buf[r.idx+newlineIdx+1:]...)
	}
}
717197
func (s *MetricAlarm) SetUnit(v string) *MetricAlarm {
	s.Unit = &v
	return s
}
486573
func (c *Conn) KillMachine(name, who string, sig syscall.Signal) error {
	return c.object.Call(dbusInterface+".KillMachine", 0, name, who, sig).Err
}