newrelic - Upstart script for New Relic monitoring plugin -
i trying start new relic monitoring plugin meetme/newrelic_plugin_agent
upstart on ubuntu 12.04. here script wrote:
env user=newrelic env daemon="/usr/local/bin/newrelic_plugin_agent" env daemonargs=" -c /etc/newrelic/newrelic_plugin_agent.cfg" start on startup stop on shutdown exec start-stop-daemon --start --chuid $user --exec $daemon --$daemonargs
the following error written corresponding upstart log: error starting /usr/local/bin/newrelic_plugin_agent: cannot write specified pid file path /var/run/newrelic/newrelic_plugin_agent.pid
if add --make-pidfile --pidfile /var/run/newrelic/newrelic_plugin_agent.pid
parameters start-stop-daemon
:
exec start-stop-daemon --start --make-pidfile --pidfile /var/run/newrelic/newrelic_plugin_agent.pid --chuid $user --exec $daemon --$daemonargs
the log contains start-stop-daemon: unable open pidfile '/var/run/newrelic/newrelic_plugin_agent.pid' writing (no such file or directory)
.
/var/run/newrelic/
folder exists , owned newrelic
user , assigned new relic
group.
how write upstart script, newrelic_plugin_agent started in boot?
i have not managed start new relic plugin using upstart, there simpler way have startet on boot. plugin contains init.d scripts redhat , ubuntu (here). just
- copy
/opt/newrelic_plugin_agent/newrelic_plugin_agent.deb
in/etc/init.d
folder:cp /opt/newrelic_plugin_agent/newrelic_plugin_agent.deb /etc/init.d/newrelic_plugin_agent
- make copied script executable:
sudo chmod a+x /etc/init.d/newrelic_plugin_agent
- configure script run on system boot:
update-rc.d newrelic_plugin_agent defaults
- start script:
/etc/init.d/newrelic_plugin_agent start
Comments
Post a Comment