From c0b0bd003d2a266441619ff8ff44eaedf5fcb2f5 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Sun, 28 Mar 2021 16:20:31 +0800 Subject: [PATCH] modify --- HttpServer/Shutdown.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HttpServer/Shutdown.php b/HttpServer/Shutdown.php index 2cadabd7..f28d5545 100644 --- a/HttpServer/Shutdown.php +++ b/HttpServer/Shutdown.php @@ -76,7 +76,8 @@ class Shutdown extends Component */ public function pidIsExists($content): bool { - $content = shell_exec('ps -eo pid,cmd,state | grep ' . $content . ' | grep -v grep'); + $shell = 'ps -eo pid,cmd,state | grep %d | grep -v grep'; + exec(sprintf($shell, $content), $content, $code); if (empty($content)) { return false; }