Skip to content

Instantly share code, notes, and snippets.

@jdeerhake
Created May 17, 2012 08:46
Show Gist options
  • Save jdeerhake/2717477 to your computer and use it in GitHub Desktop.
Save jdeerhake/2717477 to your computer and use it in GitHub Desktop.
#!upstart
description "libfitbit client"
author "John Deerhake"
version "0.0.1"
env LIBFITBIT_DIR="/etc/libfitbit"
env PYTHON="/usr/bin/python"
env LOG_FILE="/var/log/libfitbit_client.log"
env PID_FILE="/var/run/libfitbit_client.pid"
start on runlevel [235]
stop on runlevel [^235]
respawn
script
echo $$ > $PID_FILE
exec $PYTHON $LIBFITBIT_DIR/python/fitbit_client.py >> $LOG_FILE 2>&1
end script
pre-start script
echo "\n[`date`] Starting" >> $LOG_FILE 2>&1
end script
pre-stop script
rm $PID_FILE
echo "\n[`date`] Stopping" >> $LOG_FILE 2>&1
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment