zapty / forever-service

Provision node script as a service via forever, allowing it to automatically start on boot, working across various Linux distros and OS
https://github.com/zapty/forever-service
MIT License
594 stars 65 forks source link

Services doesn't start on Open VZ #65

Open ghost opened 8 years ago

ghost commented 8 years ago

Hi:

Yesterday the VPS was restarted...really I don't know why, but when It restarted, the services didn't start again.

Trying to find out the problem I've noticed that the service starts on network interface eth0 something like this:

"start on (local-filesystems and net-device-up IFACE=eth0)"

The problem is the Open VZ VPS hasn't this interface. The correct one is vnet0 or vnet0:0

Changed to the correct one the script starts node without problem

"start on (local-filesystems and net-device-up IFACE=venet0)"

Maybe an option to select the interface while you are installing the service will be good.

Thanks.

arvind-agarwal commented 8 years ago

Where are you seeing above line? Since there is no explicit interface given when provisioning the service.

ghost commented 8 years ago

I've created the script as documentation says...

something like this:

forever-service install com-hrcs-applicants -e "NODE_ENV=production" --script server.js

and it creates an startup script in /etc/init/com-applicants.conf

This line is in this script.

The script begins with:

.... description "forever-service startup script for node script based service com-applicants, uses forever to start the service"

env FOREVER_ROOT=/home/aserrano/.forever

start on (local-filesystems and net-device-up IFACE=venet0) stop on shutdown

expect fork .....

tony1016 commented 8 years ago

I have the same problem,and fixed as @aserrano1971 suggested