It does not start forever when the server reboots

I added some processes forever ( forever start script.js ), but when the server restarts forever, the list is empty and, of course, not one of them was started. Any idea to fix this because I thought I was forever running forever ...

+1
source share
1 answer

The easiest way is to start forever with /etc/rc.local. There are more complete ways to do this so that you can start / stop / etc ... or use something like monit (but this duplicates what it does forever).

You will also need to work forever with a non-root user.

start_forever.sh

 cd /absolute/path/to/project /absolute/path/to/forever -m 5 examples/error-on-timer.js& 

then to /etc/rc.local

 sudo -u SOME_USER /absolute/path/to/start_forever.sh 
+1
source

All Articles