Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame^] | 1 | Busybox does not support ps -p so use pgrep |
| 2 | |
| 3 | Upstream-Status: Inappropriate [embedded specific] |
| 4 | Based on changes from Diego Sueiro <Diego.Sueiro@arm.com> |
| 5 | |
| 6 | Signed-off-by: Armin kuster <akuster808@gmail.com> |
| 7 | |
| 8 | Index: kea-1.7.10/src/bin/keactrl/keactrl.in |
| 9 | =================================================================== |
| 10 | --- kea-1.7.10.orig/src/bin/keactrl/keactrl.in |
| 11 | +++ kea-1.7.10/src/bin/keactrl/keactrl.in |
| 12 | @@ -137,8 +137,8 @@ check_running() { |
| 13 | # Get the PID from the PID file (if it exists) |
| 14 | get_pid_from_file "${proc_name}" |
| 15 | if [ ${_pid} -gt 0 ]; then |
| 16 | - # Use ps to check if PID is alive |
| 17 | - ps -p ${_pid} 1>/dev/null |
| 18 | + # Use pgrep and grep to check if PID is alive |
| 19 | + pgrep -v 1 | grep ${_pid} 1>/dev/null |
| 20 | retcode=$? |
| 21 | if [ $retcode -eq 0 ]; then |
| 22 | # No error, so PID IS ALIVE |