linuxnode.jsphantomjsshrunit

Can't run PhantomJS with Runit (node: ../deps/uv/src/unix/core.c:431: uv__close: Assertion `fd > -1' failed)


PhantomJS works fine when I run it manually.

But when I run it with runit I get this error in the logs:

node: ../deps/uv/src/unix/core.c:431: uv__close: Assertion `fd > -1' failed.

This is the runit script in /etc/service/phantomjs/run:

#!/bin/sh

cd /
/node_modules/phantomjs/bin/phantomjs --webdriver=8643 >> /var/log/phantomjs.log 2>&1

All the other runit scripts work fine (eg: nginx, postgresql, etc.)

What can be causing this error? Why is PhantomJS behaving differently in a script run by runit?


Solution

  • I was using a local install of phantomJS. Now I tried installing it globally with npm install -g phantomjs, and used the binary it gives you after the install. It works fine.