Skip to content

Commit

Permalink
Update for new installer PID interface, and rationalise some log mess…
Browse files Browse the repository at this point in the history
…ages

Signed-off-by: Jim Hawkins <sjjhsjjhsjjh@gmail.com>
  • Loading branch information
sjjhsjjh committed May 3, 2024
1 parent b900298 commit 099e415
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/task_killer.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,21 @@ def exit(self):
exit()

def _exempt_PID(self):
pid = UpdateManager().installerPID
pid = UpdateManager().state.installerPID
if pid is not None:
yield pid

def _terminate_tree(self, process, exempt):
logger.info(f'(, {process}, {exempt})')
logger.info(f'{process=} {exempt=}')
if process.pid in exempt:
logger.info(f"Exempt:{process}.")
logger.info(f"Exempt {process.pid=}")
return
for child in process.children():
logger.info(f'Parent {process} Child {child}')
logger.info(f'Parent {process} {child=}')
self._terminate_tree(child, exempt)
logger.info(f'SIGTERM {process}')
logger.info(f'SIGTERM {process.pid=}')
try:
process.send_signal(signal.SIGTERM)
except NoSuchProcess:
pass
logger.info(f'No such process {process.pid=}')

0 comments on commit 099e415

Please sign in to comment.