summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/kea/files/fix_pid_keactrl.patch
blob: 63a6a2805bcb7f85bce3ab08608bbc8a8bda371e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From c878a356712606549f7f188b62f7d1cae08a176e Mon Sep 17 00:00:00 2001
From: Armin kuster <akuster808@gmail.com>
Date: Wed, 14 Oct 2020 22:48:31 -0700
Subject: [PATCH] Busybox does not support ps -p so use pgrep

Upstream-Status: Inappropriate [embedded specific]
Based on changes from Diego Sueiro <Diego.Sueiro@arm.com>

Signed-off-by: Armin kuster <akuster808@gmail.com>

---
 src/bin/keactrl/keactrl.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bin/keactrl/keactrl.in b/src/bin/keactrl/keactrl.in
index 450e997..c353ca9 100644
--- a/src/bin/keactrl/keactrl.in
+++ b/src/bin/keactrl/keactrl.in
@@ -149,8 +149,8 @@ check_running() {
     # Get the PID from the PID file (if it exists)
     get_pid_from_file "${proc_name}"
     if [ ${_pid} -gt 0 ]; then
-        # Use ps to check if PID is alive
-        if ps -p ${_pid} 1>/dev/null; then
+        # Use pgrep and grep to check if PID is alive
+        if pgrep -v 1 | grep ${_pid} 1>/dev/null; then
             # No error, so PID IS ALIVE
             _running=1
         fi