コード例 #1
0
    def terminate(self):
        proc = self._proc
        otherpid = self.pid

        if proc:
            if otherpid == proc.pid:
                otherpid = None
            if proc.returncode is None:
                if self.service.kill_signal is not None:  # explicitly check service
                    self.logdebug("using {0} to terminate {1}",
                                  get_signal_name(self.kill_signal), self.name)
                    proc.send_signal(self.kill_signal)
                else:
                    proc.terminate()

        if otherpid:
            self.logdebug("using {0} to terminate {1}",
                          get_signal_name(self.kill_signal), self.name)
            try:
                os.kill(otherpid, self.kill_signal)
            except Exception as ex:
                warn("{0} could not be killed using PID={1}: ".format(
                    ex, otherpid))

        self._pid = None
コード例 #2
0
ファイル: subproc.py プロジェクト: CivilPol/chaperone
    def terminate(self):
        proc = self._proc
        otherpid = self.pid

        if proc:
            if otherpid == proc.pid:
                otherpid = None
            if proc.returncode is None:
                if self.service.kill_signal is not None: # explicitly check service
                    self.logdebug("using {0} to terminate {1}", get_signal_name(self.kill_signal), self.name)
                    proc.send_signal(self.kill_signal)
                else:
                    proc.terminate()

        if otherpid:
            self.logdebug("using {0} to terminate {1}", get_signal_name(self.kill_signal), self.name)
            try:
                os.kill(otherpid, self.kill_signal)
            except Exception as ex:
                warn("{0} could not be killed using PID={1}: ".format(ex, otherpid))

        self._pid = None
コード例 #3
0
ファイル: proc.py プロジェクト: CivilPol/chaperone
 def briefly(self):
     if self.signaled or self.stopped:
         return get_signal_name(self.signal)
     if self.exited:
         return "exit({0})".format(self.exit_status)
     return '?'
コード例 #4
0
 def briefly(self):
     if self.signaled or self.stopped:
         return get_signal_name(self.signal)
     if self.exited:
         return "exit({0})".format(self.exit_status)
     return '?'