Skip to content

Instantly share code, notes, and snippets.

@walter
Created August 13, 2013 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walter/6217228 to your computer and use it in GitHub Desktop.
Save walter/6217228 to your computer and use it in GitHub Desktop.
Upstart script for a Hubot IRC Logger
description "mybot Hubot IRC bot"
# Subscribe to these upstart events
# This will make Hubot start on system boot
start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]
# Path to Hubot installation
env HUBOT_DIR='/home/botuser/bots/mybot/'
env HUBOT='runbot.sh'
env HUBOT_USER='botuser' # system account
env HUBOT_NAME='mybot' # what hubot listens to
# Keep the process alive, limit to 5 restarts in 60s
respawn
respawn limit 2 60
exec start-stop-daemon --start --chuid ${HUBOT_USER} --chdir ${HUBOT_DIR} \
--exec ${HUBOT_DIR}${HUBOT} -- --name ${HUBOT_NAME} >> /var/log/mybot.log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment