mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-30 17:50:46 +00:00
connection: Use busybox implementation of kill
Some target implementations of kill do not support killing process groups so use the busybox implementation for greater portability.
This commit is contained in:
parent
80c0e37d11
commit
6825130e48
@ -33,8 +33,8 @@ from devlib.utils.misc import InitCheckpoint
|
||||
_KILL_TIMEOUT = 3
|
||||
|
||||
|
||||
def _kill_pgid_cmd(pgid, sig):
|
||||
return 'kill -{} -{}'.format(sig.value, pgid)
|
||||
def _kill_pgid_cmd(pgid, sig, busybox):
|
||||
return '{} kill -{} -{}'.format(busybox, sig.value, pgid)
|
||||
|
||||
|
||||
class ConnectionBase(InitCheckpoint):
|
||||
@ -258,7 +258,7 @@ class ParamikoBackgroundCommand(BackgroundCommand):
|
||||
return
|
||||
# Use -PGID to target a process group rather than just the process
|
||||
# itself
|
||||
cmd = _kill_pgid_cmd(self.pid, sig)
|
||||
cmd = _kill_pgid_cmd(self.pid, sig, self.conn.busybox)
|
||||
self.conn.execute(cmd, as_root=self.as_root)
|
||||
|
||||
@property
|
||||
@ -322,7 +322,7 @@ class AdbBackgroundCommand(BackgroundCommand):
|
||||
|
||||
def send_signal(self, sig):
|
||||
self.conn.execute(
|
||||
_kill_pgid_cmd(self.pid, sig),
|
||||
_kill_pgid_cmd(self.pid, sig, self.conn.busybox),
|
||||
as_root=self.as_root,
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user