From 1ea5086d4e3cec1ba861aa9f6c845573fccc6718 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Sun, 28 Mar 2021 16:28:53 +0800 Subject: [PATCH] modify --- HttpServer/Shutdown.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/HttpServer/Shutdown.php b/HttpServer/Shutdown.php index 3f1dbe52..9f9a66b9 100644 --- a/HttpServer/Shutdown.php +++ b/HttpServer/Shutdown.php @@ -81,6 +81,9 @@ class Shutdown extends Component */ public function pidIsExists($content): bool { + if (intval($content) < 1) { + return false; + } $shell = 'ps -eo pid,cmd,state | grep %d | grep -v grep'; exec(sprintf($shell, $content), $output, $code); var_dump(sprintf($shell, $content), $output, $code);