Skip to content
Lorenzo Mangani edited this page Dec 17, 2015 · 8 revisions

HEPIPE Autostart Debian

To start HEPIPE automatically on your Debian/SPCE SIP Server you need a init.d stript for starting the HEPIPE as a service.

Requirement: The HEPIPE script is installed sucessfully.

====== 1.) Install forever

sudo npm install -g forever

2.) Make a directory for logfiles

sudo mkdir /var/run/forever

3.) Create Service file

sudo touch /etc/init.d/hepipe sudo chmod a+x /etc/init.d/hepipe sudo update-rc.d hepipe defaults

4.) Edit service file

nano /etc/init.d/hepipe

5.) Copy this content to the file:

#!/bin/sh

export PATH=$PATH:/usr/local/bin export NODE_PATH=$NODE_PATH:/usr/local/lib/node_modules

case "" in start) exec forever --sourceDir=/usr/src/hepipe.js -p /var/run/forever start -o ./log/hepipe.log -e ./log/error.log -a --minUptime 1000 --spinSleepTime 3000 ./hepipe.js ;; stop) exec forever stop --sourceDir=/usr/src/hepipe.js hepipe.js ;; status) forever list |grep -q hepipe || exit 1 ;; esac

exit 0

6.) Save the file and try to start the HEPIPE service with "service hepipe start".

The hepipe service starts now automatically on boot up and shows status if running or not if you type in "service --status-all"

Clone this wiki locally