Can't run node.js script on server reboot

Posted by webstyle on Server Fault See other posts from Server Fault or by webstyle
Published on 2014-06-04T09:36:56Z Indexed on 2014/06/08 9:27 UTC
Read the original article Hit count: 377

Filed under:
|
|

I need to listen events on port 3240 and I'm using node.js for that purpose. I need to execute my script with forever tool. I also need to run forever on server reboot.

When I run forever glh.js everything works: forever list says there is a running process.

But when I'm trying to run forever on server reboot I can't get it working.

I've created a file in /etc/init.d with the following content:

#!/bin/bash

/var/www/yan/data/gitlabhook/runglh.sh &>/var/www/yan/data/gitlabhook/runglh.log

When I reboot the server, the output log is the following (the same as when I run it manually via console):

info:    Forever processing file: glh.js

But in this case forever doesn't start a process. forever list outputs:

info:    No forever processes running

© Server Fault or respective owner

Related posts about debian

Related posts about node.js