Monit 无法重新启动 HHVM

Monit 无法重新启动 HHVM

似乎 monit 在关闭时无法重新启动 HHVM,但根据错误日志判断,我不太明白为什么它无法重新启动它:

[UTC Dec 22 09:45:36] info     : 'hhvm' trying to restart
[UTC Dec 22 09:45:36] info     : 'hhvm' start: /etc/init.d/hhvm
[UTC Dec 22 09:45:36] error    : monit: Error reading pid from file '/var/run/hhvm/pid'
[UTC Dec 22 09:45:36] error    : monit: Error reading pid from file '/var/run/hhvm/pid'
[UTC Dec 22 09:45:37] error    : monit: Error reading pid from file '/var/run/hhvm/pid'
[UTC Dec 22 09:46:37] error    : 'hhvm' failed to start
[UTC Dec 22 09:46:42] error    : 'hhvm' process is not running
[UTC Dec 22 09:46:42] info     : 'hhvm' trying to restart
[UTC Dec 22 09:46:42] info     : 'hhvm' start: /etc/init.d/hhvm
[UTC Dec 22 09:47:42] error    : 'hhvm' failed to start
[UTC Dec 22 09:47:47] error    : 'hhvm' process is not running
[UTC Dec 22 09:47:47] info     : 'hhvm' trying to restart
[UTC Dec 22 09:47:47] info     : 'hhvm' start: /etc/init.d/hhvm
[UTC Dec 22 09:48:47] error    : 'hhvm' failed to start
[UTC Dec 22 09:48:52] error    : 'hhvm' process is not running
[UTC Dec 22 09:48:52] info     : 'hhvm' trying to restart
[UTC Dec 22 09:48:52] info     : 'hhvm' start: /etc/init.d/hhvm
[UTC Dec 22 09:49:52] error    : 'hhvm' failed to start
[UTC Dec 22 09:49:57] error    : 'hhvm' process is not running
[UTC Dec 22 09:49:57] info     : 'hhvm' trying to restart

它每 5 秒钟通过端口 80 调用一次网站,如果网站关闭,它会尝试重新启动它,但由于某种原因它似乎无法做到这一点:

Config snippet :

check process hhvm with pidfile /var/run/hhvm/pid
    start program = "/etc/init.d/hhvm start" with timeout 60 seconds
    stop program = "/etc/init.d/hhvm stop"
    if failed host domain.com port 80 protocol http
        and request "/index.php"
    then restart

知道原因吗?如果不知道,还有其他更好的方法检查 HHVM 并在发生故障时重新启动它吗?

这是错误日志@ hhvm

Unable to start page server
Shutting down due to failure(s) to bind in HttpServer::runAndExitProcess
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"
command failed: "lsof -t -i :9000 | xargs kill -9"

答案1

在我的情况下,这是由于 pid 所在目录的用户权限问题而触发的。我正在使用与默认 www-data 用户不同的用户测试 hhvm,但意外地使用该用户启动了 hhvm。这更改了该目录的权限(默认情况下为 /var/run/hhvm)

修复权限使我能够摆脱这个问题。

相关内容