Created
August 13, 2013 02:13
-
-
Save walter/6217228 to your computer and use it in GitHub Desktop.
Upstart script for a Hubot IRC Logger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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