Skip to content

Instantly share code, notes, and snippets.

@hazanjon
Created January 31, 2014 01:53
Show Gist options
  • Save hazanjon/8725263 to your computer and use it in GitHub Desktop.
Save hazanjon/8725263 to your computer and use it in GitHub Desktop.
Ubuntu Upstart file for Jekyll server
description "Jekyll node.js server"
author "Jon Hazan<[email protected]>"
env USER=www-data
env SITENAME=yoursite.com
env SITEDIR=/var/www/yoursite.com/
env JEKYLL=/usr/local/bin/jekyll
#Make sure mounting is completed before starting
start on started mountall
stop on shutdown
# Automatically Respawn:
respawn
respawn limit 99 5
script
export HOME="/root"
export LANG="en_US.UTF-8"
exec start-stop-daemon --make-pid --start --pidfile /var/run/$SITENAME.pid --chdir $SITEDIR --chuid $USER:$USER --exec $JEKYLL serve -- build --watch >> /var/log/jekyll-$SITENAME.log 2>&1
end script
post-start script
# Optionally put a script here that will notifiy you node has (re)started
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment