当我手动运行时,PhantomJS 工作正常。
但是当我用 runit 运行它时我在日志中收到此错误:
node: ../deps/uv/src/unix/core.c:431: uv__close: Assertion `fd > -1' failed.
这是 /etc/service/phantomjs/run
中的 runit 脚本:
#!/bin/sh
cd /
/node_modules/phantomjs/bin/phantomjs --webdriver=8643 >> /var/log/phantomjs.log 2>&1
所有其他 runit 脚本都可以正常工作(例如:nginx、postgresql 等)
什么可能导致此错误?为什么 PhantomJS 在 runit 运行的脚本中表现不同?
最佳答案
我使用的是本地安装的 phantomJS。现在我尝试使用 npm install -g phantomjs 进行全局安装,并使用安装后提供的二进制文件。效果很好。
关于linux - 无法使用 Runit 运行 PhantomJS( Node : . ./deps/uv/src/unix/core.c:431: uv__close: 断言 `fd > -1' 失败),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23185956/