Skip to content

Commit d1db1cf

Browse files
xiangjihaninhere
authored andcommitted
修复执行php bin/swoft stop命令时master进程异常未退出的问题,以及停止失败后,pid文件被删除的问题 (#134)
* 修复执行php bin/swoft stop命令时master进程异常未退出的问题; 修复执行php bin/swoft stop失败,但pid文件仍被删除的问题。 * Update AbstractServer.php
1 parent 649e67a commit d1db1cf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Command/ServerCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ public function stop()
122122
$serverStatus = $httpServer->getServerSetting();
123123
$pidFile = $serverStatus['pfile'];
124124

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

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

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

0 commit comments

Comments
 (0)