Error message

Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; GeSHi has a deprecated constructor in require_once() (line 915 of /var/www/

Managing a Node.js server process with forever and an LSB-style init script for Debian

Want to run a Node.js process in the background with a good assurance it'll stay running?  Forever ( provides some level of management and monitoring that a process you put in the background will keep running, and be restarted if it crashes.  Additionally you're likely to want to have the process (forever plus your server) started automagically when the system boots up.

This shell script is a not-quite-LSB-compliant init script that works on Debian (if you ignore a warning that's printed when you install it) and should demonstrate a little about using Forever.

#! /bin/sh -e
set -e
case "$1" in
start) forever start $DAEMON ;;
stop) forever stop $DAEMON ;;
forever restart $DAEMON ;;
*) echo "Usage: /etc/init.d/node {start|stop|restart|force-reload}"
exit 1
exit 0