Skip to content

Instantly share code, notes, and snippets.

@missinglink
Created July 7, 2014 17:17
Show Gist options
  • Select an option

  • Save missinglink/fdec4bd4fb4926bc37dc to your computer and use it in GitHub Desktop.

Select an option

Save missinglink/fdec4bd4fb4926bc37dc to your computer and use it in GitHub Desktop.
Pelias Upstart Script
#!upstart
description "pelias server"
author "wiz@wiz.co.nz"
start on startup
stop on shutdown
script
export HOME="/var/www/pelias-webview"
export NODE_ENV="production"
chdir "/var/www/pelias-webview"
echo $$ > /var/run/pelias.pid
exec /usr/local/bin/node /var/www/pelias-webview/app.js >> /var/log/pelias.sys.log 2>&1
end script
pre-start script
# Date format same as (new Date()).toISOString() for consistency
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /var/log/pelias.sys.log
end script
pre-stop script
rm /var/run/pelias.pid
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/log/pelias.sys.log
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment