This commit is contained in:
2021-11-04 18:22:42 +08:00
parent 0cf17a547e
commit a4a9a5618d
@@ -67,18 +67,21 @@ class FileChangeCustomProcess extends Command
go(function () { go(function () {
$sign = Coroutine::waitSignal(SIGTERM, -1); $sign = Coroutine::waitSignal(SIGTERM, -1);
if ($sign) { if ($sign) {
proc_close($this->source);
} }
}); });
go(function () use ($driver) { go(function () use ($driver) {
$driver->start(); $driver->start();
}); });
$this->source = proc_open("php " . APP_PATH . "kiri.php sw:server restart", go(function () {
[ $this->source = proc_open("php " . APP_PATH . "kiri.php sw:server restart",
0 => ["pipe", "r"], // 标准输入,子进程从此管道中读取数据 [
1 => ["pipe", "w"], // 标准输,子进程此管道中写入数据 0 => ["pipe", "r"], // 标准输,子进程此管道中读取数据
2 => ["file", "/tmp/error-output.txt", "a"] // 标准错误,写入到一个文件 1 => ["pipe", "w"], // 标准输出,子进程向此管道中写入数据
] 2 => ["file", "/tmp/error-output.txt", "a"] // 标准错误,写入到一个文件
, $this->pipes); ]
, $this->pipes);
});
var_dump($this->source, $this->pipes); var_dump($this->source, $this->pipes);
Barrier::wait($make); Barrier::wait($make);