Last active
February 23, 2016 10:51
-
-
Save vnglst/326efb4dfc1245ac89ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Upstart service for term.world node application | |
# Save in /etc/init/termworld.conf | |
description "Term.world node js application" | |
author "Koen van Gilst" | |
start on filesystem or runlevel [2345] | |
stop on shutdown or on runlevel [016] | |
setuid caddy | |
setgid caddy | |
# Respawn in case of a crash, with default parameters | |
respawn | |
respawn limit 10 5 | |
script | |
export HOME=/opt/term.world/ | |
export NODE_ENV="production" | |
export PORT=2016 | |
echo $$ > /home/caddy/pids/termworld.pid | |
exec /usr/local/bin/node /opt/term.world/server.js >> /home/caddy/log/termworld.sys.log 2>&1 | |
end script | |
pre-start script | |
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /home/caddy/log/termworld.sys.log | |
echo "Term Search started at `date +"%F %T.%N"`" | mail -s "Term Search Started" xxx@xxx.de | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment