RPi init script to run NodeJsController at boot time

execute the following to install:
chmod 755 *.sh
sudo cp NodeJsControllerInitScript.sh /etc/init.d/mysensors
sudo update-rc.d mysensors defaults
sudo mkdir -p /usr/local/var/run
sudo chmod -R 777 /usr/local/var/run
This commit is contained in:
ToSa27
2014-08-21 00:50:57 +02:00
parent ec5a9c0597
commit b936e0aebe
2 changed files with 168 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
#!/bin/sh
# pidfile must be first argument
PIDFILE=$1
mkdir -p /home/pi/logs
cd /home/pi/Arduino/NodeJsController
/opt/node/bin/node NodeJsController.js >>/home/pi/logs/NodeJsController.log 2>&1 </dev/null &
CHILD="$!"
echo $CHILD > $PIDFILE