Skip to content

Instantly share code, notes, and snippets.

@DavidWittman
Created March 6, 2012 05:55
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save DavidWittman/1983925 to your computer and use it in GitHub Desktop.
Save DavidWittman/1983925 to your computer and use it in GitHub Desktop.
Hubot Upstart Script
# hubot
description "Hubot Campfire bot"
author "David Wittman <david@wittman.com>"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
# Path to Hubot installation
env HUBOT_DIR='/opt/hubot/'
env HUBOT='bin/hubot'
env ADAPTER='campfire'
# Name (and local user) to run Hubot as
env HUBOT_USER='hubot'
# httpd listen port
env PORT='5555'
# Campfire-specific environment variables
env HUBOT_CAMPFIRE_TOKEN=''
env HUBOT_CAMPFIRE_ACCOUNT=''
env HUBOT_CAMPFIRE_ROOMS=''
# Keep the process alive, limit to 5 restarts in 60s
respawn
respawn limit 5 60
exec start-stop-daemon --start --chuid ${HUBOT_USER} --chdir ${HUBOT_DIR} \
--exec ${HUBOT_DIR}${HUBOT} -- --name ${HUBOT_USER} --adapter ${ADAPTER}
@ezgoodnight
Copy link

This is a great, very helpful script. My only issue was that I was confused by the port as this limits it to listening only to 5555 when (what I think) the default is 8080. This created an issue with the hubot refusing all of my curl scripts and I had no idea why. Not sure if 5555 is a specific port others use or as an arbitrary number for a placeholder. Perhaps add a comment or change it to 8080 in the script?

Thanks for sharing this, it helps tremendously.

@Fedcomp
Copy link

Fedcomp commented Oct 26, 2015

It can be any port, it's just used by hubot so it doesnt interfere with real webserver.

@Kentzo
Copy link

Kentzo commented Dec 13, 2015

Shouldn't it be --startas instead of --exec?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment