This commit is contained in:
as2252258@163.com
2021-03-28 16:24:59 +08:00
parent 1f639b499d
commit 876dc960b2
+3 -3
View File
@@ -77,8 +77,8 @@ class Shutdown extends Component
public function pidIsExists($content): bool public function pidIsExists($content): bool
{ {
$shell = 'ps -eo pid,cmd,state | grep %d | grep -v grep'; $shell = 'ps -eo pid,cmd,state | grep %d | grep -v grep';
exec(sprintf($shell, $content), $content, $code); exec(sprintf($shell, $content), $output, $code);
var_dump(sprintf($shell, $content), $content, $code); var_dump(sprintf($shell, $content), $output, $code);
if (empty($content)) { if (empty($content)) {
return false; return false;
} }
@@ -117,7 +117,7 @@ class Shutdown extends Component
fclose($resource); fclose($resource);
while ($this->pidIsExists($content)) { while ($this->pidIsExists($content)) {
exec('kill -15 ' . $content); // exec('kill -15 ' . $content);
sleep(1); sleep(1);
} }