Hi Mariano, On Mon, Feb 17, 2014 at 11:43:16AM -0300, Mariano González wrote: > Hi guys. > I'm asking for help to write a script to monitor a newrelic agent. > Here's what I have now: https://gist.github.com/marianogg9/9002995 > As you may see, the service won't start and will respawn 10 times. I think > this is an env issue, but I tried with export and env stanzas without > success. > Any comments will be really appreciated. > Thanks!
Your upstart job does: exec sudo -u root 'bundle exec /path_to_plugin/newrelic/newrelic_rs_dfw/bin/newrelic_rs' The obvious issue here is that this is the wrong syntax. Quoting the string 'bundle exec [...]' causes sudo to try to find a program named 'bundle exec [...]', instead of executing the program 'bundle' with arguments 'exec', [...]. Note that it's recommended to not use sudo for upstart jobs, in general, as sudo spawns an associated PAM session which is normally not what you want. And if all you care about is the user id, then 'sudo -u root' is redundant since all system jobs run as root by default. Finally, if you have any further problems with this job, try looking in /var/log/upstart/newrelic.log. Assuming you're running a new enough upstart, you will have logs there (including the error output of your failed sudo commands). Hope that helps, -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer http://www.debian.org/ [email protected] [email protected]
signature.asc
Description: Digital signature
-- upstart-devel mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/upstart-devel
