blob: b7c2fd4f0d1c93818c244c950140296df4e8389e [file] [log] [blame]
Andrew Geisslereff27472021-10-29 15:35:00 -05001From 18f4f6206c248d6169aa67b3ecf16bf54e9292e8 Mon Sep 17 00:00:00 2001
2From: Armin kuster <akuster808@gmail.com>
3Date: Wed, 14 Oct 2020 22:48:31 -0700
4Subject: [PATCH] Busybox does not support ps -p so use pgrep
Andrew Geissler4c19ea12020-10-27 13:52:24 -05005
6Upstream-Status: Inappropriate [embedded specific]
7Based on changes from Diego Sueiro <Diego.Sueiro@arm.com>
8
9Signed-off-by: Armin kuster <akuster808@gmail.com>
10
Andrew Geisslereff27472021-10-29 15:35:00 -050011---
12 src/bin/keactrl/keactrl.in | 4 ++--
13 1 file changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/src/bin/keactrl/keactrl.in b/src/bin/keactrl/keactrl.in
16index ae5bd8e..e9f9b73 100644
17--- a/src/bin/keactrl/keactrl.in
18+++ b/src/bin/keactrl/keactrl.in
19@@ -151,8 +151,8 @@ check_running() {
Andrew Geissler4c19ea12020-10-27 13:52:24 -050020 # Get the PID from the PID file (if it exists)
21 get_pid_from_file "${proc_name}"
22 if [ ${_pid} -gt 0 ]; then
23- # Use ps to check if PID is alive
Andrew Geisslereff27472021-10-29 15:35:00 -050024- if ps -p ${_pid} 1>/dev/null; then
Andrew Geissler4c19ea12020-10-27 13:52:24 -050025+ # Use pgrep and grep to check if PID is alive
Andrew Geisslereff27472021-10-29 15:35:00 -050026+ if pgrep -v 1 | grep ${_pid} 1>/dev/null; then
Andrew Geissler4c19ea12020-10-27 13:52:24 -050027 # No error, so PID IS ALIVE
Andrew Geisslereff27472021-10-29 15:35:00 -050028 _running=1
29 fi