From 82f7966de339854c4292fdd84e3397ee20d44525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 29 Mar 2021 11:11:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Shutdown.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/HttpServer/Shutdown.php b/HttpServer/Shutdown.php index 031023c7..a078da0c 100644 --- a/HttpServer/Shutdown.php +++ b/HttpServer/Shutdown.php @@ -6,6 +6,8 @@ namespace HttpServer; use Exception; use Snowflake\Abstracts\Component; +use Snowflake\Abstracts\Config; +use Snowflake\Exception\ConfigException; /** @@ -85,14 +87,15 @@ class Shutdown extends Component /** * @param $content * @return bool + * @throws ConfigException */ public function pidIsExists($content): bool { if (intval($content) < 1) { return false; } - $shell = 'ps -eo pid,state | grep %d | grep -v grep'; - exec(sprintf($shell, intval($content)), $output, $code); + $shell = 'ps -eo pid,state | grep %d | grep %s | grep -v grep'; + exec(sprintf($shell, intval($content), Config::get('id')), $output, $code); var_dump(sprintf($shell, intval($content))); if (empty($output)) { return false;