1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-24 21:15:10 +03:00

pmb.helpers.run_core.kill_commands: use minimal subset of ps parameters (MR 2074)

again, busybox ps supports only -o option (-e is ignored, because
busybox always shows all processes).
This commit is contained in:
Maxim Karasev 2021-06-24 02:52:37 +03:00 committed by Alexey Min
parent 31e7a0006d
commit 1bb15765ed
No known key found for this signature in database
GPG key ID: EBF5ECFFFEE34DED
2 changed files with 5 additions and 5 deletions

View file

@ -110,10 +110,10 @@ def kill_command(args, pid, sudo):
:param pid: process id that will be killed
:param sudo: use sudo to kill the process
"""
cmd = ["ps", "-e", "-o", "pid=,ppid=", "--noheaders"]
cmd = ["ps", "-e", "-o", "pid,ppid"]
ret = subprocess.run(cmd, check=True, stdout=subprocess.PIPE)
ppids = []
proc_entries = ret.stdout.decode("utf-8").rstrip().split('\n')
proc_entries = ret.stdout.decode("utf-8").rstrip().split('\n')[1:]
for row in proc_entries:
items = row.split()
if len(items) != 2: