newrelic_platform_plugins
newrelic_platform_plugins copied to clipboard
Add init.d script
It would be good if it included an init.d script for starting this as a service.
+1
Am I missing something or is the plugin only able to run in the foreground? Doesn't that kinda defeat the purpose if it's not a daemon?
We use screen for all plugins currently, this allows for easy monitoring and keeps everything the same when monitoring the various plugins already published...
+1
You can use services like these to manage this process and run it as a daemon.
Also you can use foreman for daemonization.
Foreman can be useful if you want to use Heroku for run your agent. Just add Procfile and push to Heroku.
monitor_daemon: bundle exec ruby newrelic_haproxy_agent.rb
So, actually starting this as a service depends on the system. Some people use windows hosting too.
May be it makes sense to add Upstart script here, because Upstart is the new way most Linux distros (including Ubuntu) deal with deamons. What do you think?
Waiting your comments, guys! )
All of the above ;-)
Personally we use Ubuntu so an Upstart script would work just as well for me. At least start with that and some instructions and add others as people request them. I would add them and do a pull request but my programming skills don't really stretch that far sorry!
+1
I'm trying to set this up with Monit but I need to give it a PID file.
+1 for this issue
I would prefer the init.d stuff to be configured and tested by the developers who built the software.
I wrote an Upstart script to daemonize since my server was Ubuntu. It is my first upstart script (and may not be perfect) but it works for me and it may help others.
https://github.com/badmadrad/newrelic/blob/master/newrelic_haproxy_agent_upstart.conf
Here is an example of a Daemons script to run any of the plug-in agents as a Daemon: First: gem install daemons Then: https://gist.github.com/erikwennerberg/7143226
To capture the PID correctly for monit, I used a wrapper script: https://gist.github.com/qixtand/7364575