walnut.js/upstart-walnut

25 lines
617 B
Plaintext
Raw Normal View History

2015-04-01 16:46:11 +00:00
# sudo rsync -av upstart-walnut /etc/init/walnut.conf
# sudo service walnut restart
description "WALNUT application host"
version "1.0"
author "AJ ONeal"
# Upstart has nothing in $PATH by default
env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Keep the server running on crash or machine reboot
respawn
respawn limit 10 120
start on runlevel [2345]
# Start the server using spark and redirect output to log files
script
DATE=`date '+%F_%H-%M-%S'`
cd /srv/walnut/
mkdir -p logs
exec node bin/walnut \
> "./logs/access.${DATE}.log" \
2> "./logs/error.${DATE}.log"
end script