Skip to content

Instantly share code, notes, and snippets.

@marianogg9
Created February 14, 2014 15:29
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 marianogg9/9002995 to your computer and use it in GitHub Desktop.
Save marianogg9/9002995 to your computer and use it in GitHub Desktop.
newrelic.conf script
# The current user of the plugin (and subfolders) is root, so I've written this upstart script:
#
# Rackspace NewRelic plugin
# This script keeps this service running.
start on runlevel [2345]
stop on runlevel [016]
pre-start script
echo '{"name": "check_respawn", "output": "newrelic_rs_dfw service respawned", "status": 2, "handlers": ["twitter"], "subscribers": "aws"}' | nc localhost 3030
end script
respawn
exec sudo -u root 'bundle exec /path_to_plugin/newrelic/newrelic_rs_dfw/bin/newrelic_rs'
----------------------------------------------------------------------------------------------------
(Don't mind the pre-start script, it's my way to send alerts to my sensu server)
And /var/log/messages tells me:
Feb 7 18:33:52 ip-172-30-1-9 init: newrelic_rs_dfw_test goal changed from stop to start
Feb 7 18:33:52 ip-172-30-1-9 init: newrelic_rs_dfw_test state changed from waiting to starting
Feb 7 18:33:52 ip-172-30-1-9 init: newrelic_rs_dfw_test state changed from starting to pre-start
Feb 7 18:33:52 ip-172-30-1-9 init: newrelic_rs_dfw_test pre-start process(26378)
Feb 7 18:33:52 ip-172-30-1-9 init: newrelic_rs_dfw_test pre-start process(26378) exited normally
Feb 7 18:33:52 ip-172-30-1-9 init: newrelic_rs_dfw_test state changed from pre-start to spawned
Feb 7 18:33:52 ip-172-30-1-9 init: newrelic_rs_dfw_test main process (26381)
Feb 7 18:33:52 ip-172-30-1-9 init: newrelic_rs_dfw_test state changed from spawned to post-start
Feb 7 18:33:52 ip-172-30-1-9 init: newrelic_rs_dfw_test state changed from post-start to running
Feb 7 18:33:52 ip-172-30-1-9 init: newrelic_rs_dfw_test main process (26381) terminated with status 1
Feb 7 18:33:52 ip-172-30-1-9 init: newrelic_rs_dfw_test main process ended, respawning
Feb 7 18:33:52 ip-172-30-1-9 init: newrelic_rs_dfw_test state changed from running to stopping
Feb 7 18:33:52 ip-172-30-1-9 init: newrelic_rs_dfw_test state changed from stopping to killed
Feb 7 18:33:52 ip-172-30-1-9 init: newrelic_rs_dfw_test state changed from killed to post-stop
And respawns ten times and then dies..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment