(self)
| 39 | CsHelper.execute("kill -9 %s" % p) |
| 40 | |
| 41 | def find_pid(self): |
| 42 | self.pid = [] |
| 43 | items = len(self.search) |
| 44 | for i in CsHelper.execute("ps aux"): |
| 45 | proc = re.split(r"\s+", i)[10:] |
| 46 | matches = len([m for m in proc if m in self.search]) |
| 47 | if matches == items: |
| 48 | self.pid.append(re.split(r"\s+", i)[1]) |
| 49 | |
| 50 | logging.debug("CsProcess:: Searching for process ==> %s and found PIDs ==> %s", self.search, self.pid) |
| 51 | return self.pid |
| 52 | |
| 53 | def find(self): |
| 54 | has_pid = len(self.find_pid()) > 0 |