This commit is contained in:
2021-03-01 15:36:35 +08:00
parent 179a50d587
commit db3bc33aa3
+3 -6
View File
@@ -50,20 +50,17 @@ trait Action
*/ */
private function _shutdown($server) private function _shutdown($server)
{ {
$content = file_get_contents($this->getPidFile()); $pid_file = $this->getPidFile();
if (!file_exists($content)) { if (!file_exists($pid_file)) {
return; return;
} }
if (empty($content)) { $content = file_get_contents($pid_file);
$this->close($server);
} else {
exec("ps -ef $content | grep $content", $output); exec("ps -ef $content | grep $content", $output);
if (!empty($output)) { if (!empty($output)) {
exec("kill -15 $content"); exec("kill -15 $content");
} }
$this->close($server); $this->close($server);
} }
}
/** /**