[CRIU] [PATCH 2/6] zdtm: Replace `ps -p` with `kill -0`

Christopher Covington cov at codeaurora.org
Wed Aug 6 15:02:10 PDT 2014


The -p argument to `ps` is not supported by Busybox v1.19.4. Sending
signal 0 with the `kill` command is an alternative way to check
whether a process is still running.

http://www.linuxjournal.com/content/monitoring-processes-kill-0

Signed-off-by: Christopher Covington <cov at codeaurora.org>
---
 test/zdtm.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/zdtm.sh b/test/zdtm.sh
index 19f74da..55e333a 100755
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -403,7 +403,7 @@ start_test()
 	[ -z "$PIDNS" ] || cd -
 
 	PID=`cat "$TPID"` || return 1
-	if ! ps -p $PID ; then
+	if ! kill -0 $PID ; then
 		echo "Test failed to start"
 		return 1
 	fi
-- 
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by the Linux Foundation.



More information about the CRIU mailing list