xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 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
5
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
11---
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() {
20     # 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
24-        if ps -p ${_pid} 1>/dev/null; then
25+        # Use pgrep and grep to check if PID is alive
26+        if pgrep -v 1 | grep ${_pid} 1>/dev/null; then
27             # No error, so PID IS ALIVE
28             _running=1
29         fi
30