newrelic_platform_plugins icon indicating copy to clipboard operation
newrelic_platform_plugins copied to clipboard

Add init.d script

Open barnaclebarnes opened this issue 11 years ago • 11 comments

It would be good if it included an init.d script for starting this as a service.

barnaclebarnes avatar Jun 20 '13 04:06 barnaclebarnes

+1

troyschneringer avatar Jun 21 '13 05:06 troyschneringer

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?

payomdousti avatar Jun 24 '13 17:06 payomdousti

We use screen for all plugins currently, this allows for easy monitoring and keeps everything the same when monitoring the various plugins already published...

fruitl00p avatar Jun 25 '13 10:06 fruitl00p

+1

wevtimoteo avatar Jun 25 '13 21:06 wevtimoteo

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! )

maxtor avatar Jun 29 '13 04:06 maxtor

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!

barnaclebarnes avatar Jul 01 '13 02:07 barnaclebarnes

+1

I'm trying to set this up with Monit but I need to give it a PID file.

jonathanng avatar Aug 05 '13 16:08 jonathanng

+1 for this issue

I would prefer the init.d stuff to be configured and tested by the developers who built the software.

electricowl avatar Aug 12 '13 14:08 electricowl

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

mar-io avatar Sep 20 '13 18:09 mar-io

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

erikwennerberg avatar Oct 24 '13 19:10 erikwennerberg

To capture the PID correctly for monit, I used a wrapper script: https://gist.github.com/qixtand/7364575

qixtand avatar Nov 08 '13 01:11 qixtand