Skip to content

Instantly share code, notes, and snippets.

@colthreepv
Created March 13, 2015 13:59
Show Gist options
  • Save colthreepv/6c47bc1dc231e91dd4ce to your computer and use it in GitHub Desktop.
Save colthreepv/6c47bc1dc231e91dd4ce to your computer and use it in GitHub Desktop.
Example upstart script to use with prerender-server https://prerender.io/
description "<description here>"
author "<[email protected]>"
start on filesystem or runlevel [2345]
stop on shutdown
# Automatically Respawn:
respawn
respawn limit 3 5
setuid www-data
setgid adm
env PORT=9000
script
exec /usr/local/bin/node /srv/prerender/prerender.js >> /var/log/services/prerender.log 2>&1
end script
pre-start script
echo "[`date`] prerender listening on http://127.0.0.1:$PORT/" >> /var/log/services/prerender.log
end script
pre-stop script
echo "[`date`] prerender stopping" >> /var/log/services/prerender.log
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment