Gets the PIDs of the process. In some circumstances, a process can run multiple times, e.g. when it forks in the Breakpad crash handler. Returns an empty list if no PIDs can be determined.
(self)
| 447 | return pid |
| 448 | |
| 449 | def get_pids(self): |
| 450 | """Gets the PIDs of the process. In some circumstances, a process can run multiple |
| 451 | times, e.g. when it forks in the Breakpad crash handler. Returns an empty list if no |
| 452 | PIDs can be determined.""" |
| 453 | pids = [proc['pid'] for proc in self.__get_procs()] |
| 454 | if pids: |
| 455 | LOG.info("Found PIDs %s for %s" % (", ".join(map(str, pids)), " ".join(self.cmd))) |
| 456 | else: |
| 457 | LOG.info("No PID found for process cmdline: %s. Process is dead?" % |
| 458 | " ".join(self.cmd)) |
| 459 | return pids |
| 460 | |
| 461 | def __procs_str(self, procs): |
| 462 | return "\n".join([str(proc) for proc in procs]) |