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:
parent
31e7a0006d
commit
1bb15765ed
2 changed files with 5 additions and 5 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue