Skip to content

Instantly share code, notes, and snippets.

@jeanlaurent
Last active December 27, 2015 13:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jeanlaurent/7336978 to your computer and use it in GitHub Desktop.
Save jeanlaurent/7336978 to your computer and use it in GitHub Desktop.
Node.js npm server upstart conf
# tapei.conf
description "This is a *very* simple elevator implementation serving as a starting point for code-story S03E01"
start on startup
stop on shutdown
script
echo $$ > /var/run/tapei.pid
mkdir -p /home/jlm/tapei
cd /home/jlm/tapei
exec sudo -u jlm /usr/bin/npm start
end script
pre-start script
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /var/log/tapei.sys.log
end script
pre-stop script
rm /var/run/tapei.pid
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/log/tapei.sys.log
end script
respawn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment