Skip to content

Instantly share code, notes, and snippets.

@augustj
Created December 6, 2013 22:09
Show Gist options
  • Save augustj/7832982 to your computer and use it in GitHub Desktop.
Save augustj/7832982 to your computer and use it in GitHub Desktop.
Upstart script for New Relic Redis agent
#
# This is provided as an example of a Ubuntu style upstart script
# You'll want to give it a more useful name
#
# pivotal_agent - myservice job file
description "Pivotal Monitoring Agent for New Relic"
author "Pivotal - https://github.com/gopivotal/newrelic_pivotal_agent/"
# Change this to the user running the agent
env USER=newrelic
# When to start the service
start on runlevel [2345]
# When to stop the service
stop on runlevel [016]
# Automatically restart process if crashed
respawn
# Run before process
pre-start script
[ -d /var/log/pivotal_agent ] || mkdir -p /var/log/pivotal_agent
end script
# This assumes that start-stop-daemon is present on the system
# Change this to the path where pivotal_agent is located
exec start-stop-daemon --start --make-pidfile --pidfile /var/run/pivotal_agent.pid --chuid $USER --exec /home/augustj/.rbenv/shims/ruby /etc/newrelic_redis_agent/pivotal_agent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment