5 post-start script # log that we restarted logger -is -t "$UPSTART_JOB" ">>>>>>>> jsbin restart" # email the last 100 lines from the log tail -100 /var/log/upstart/jsbin.log | mail -s "ALARM: jsbin restart" [email protected] end script script set -e # make sure you only write out to /var/log/upstart/<task> exec sudo -u www-data PORT=8000 /usr/local/bin/node /WWW/jsbin/ 2>&1 end script https://github.com/jsbin-org/production/blob/master/apps.jsbin.com/etc/init/jsbin.conf