From e843aeac5593d92e9e9560b820cf95023603ce37 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 6 May 2022 23:36:29 +0800 Subject: [PATCH] prevent server:stop command error when daemon file not exists --- src/ZM/Command/Server/ServerStopCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ZM/Command/Server/ServerStopCommand.php b/src/ZM/Command/Server/ServerStopCommand.php index 165faad8..c78eeefc 100644 --- a/src/ZM/Command/Server/ServerStopCommand.php +++ b/src/ZM/Command/Server/ServerStopCommand.php @@ -43,7 +43,9 @@ class ServerStopCommand extends DaemonCommand } else { parent::execute($input, $output); } - Process::kill(intval($this->daemon_file['pid']), SIGTERM); + if ($this->daemon_file !== null) { + Process::kill(intval($this->daemon_file['pid']), SIGTERM); + } $i = 10; while (Framework::getProcessState(ZM_PROCESS_MASTER) !== false && $i > 0) { sleep(1);