Skip to content

Commit

Permalink
修复执行php bin/swoft stop命令时master进程异常未退出的问题,以及停止失败后,pid文件被删除的问题 (#134)
Browse files Browse the repository at this point in the history
* 修复执行php bin/swoft stop命令时master进程异常未退出的问题;
修复执行php bin/swoft stop失败,但pid文件仍被删除的问题。

* Update AbstractServer.php
  • Loading branch information
xiangjihan authored and inhere committed Jul 20, 2018
1 parent 649e67a commit d1db1cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Command/ServerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public function stop()
$serverStatus = $httpServer->getServerSetting();
$pidFile = $serverStatus['pfile'];

@unlink($pidFile);
\output()->writeln(sprintf('<info>Swoft %s is stopping ...</info>', input()->getScript()));

$result = $httpServer->stop();
Expand All @@ -131,6 +130,8 @@ public function stop()
if (!$result) {
\output()->writeln(sprintf('<error>Swoft %s stop fail</error>', input()->getScript()), true, true);
}
//删除pid文件
@unlink($pidFile);

output()->writeln(sprintf('<success>Swoft %s stop success!</success>', input()->getScript()));
}
Expand Down

0 comments on commit d1db1cf

Please sign in to comment.