<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Hi Steve and Clint. Thanks for your comments.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">
@Steve</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">You're totally right, it's not necessary to write sudo -u root as it's the same as writing sudo. My fault there.</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif">But, the command to run the agent is the following:</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">
$ cd /path/newrelic_rs_dfw/</div><div class="gmail_default" style="font-family:tahoma,sans-serif">$ bundle exec ./bin/newrelic_rs</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">
As bundle exec is a ruby gem located in /path/newrelic_rs_dfw/. So, to this script to function it'd need to locate in /path/newrelic_rs_dfw/ first and then run the bundle exec. Which it doesn't do if I write down those two previous steps in a script. Neither it does if I specify an env variable or source stanza. That's why I think this is an env issue.</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">@Clint</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
</div><div class="gmail_default" style="font-family:tahoma,sans-serif">I'm trying to run this agent as an Upstart job, that's why I'm writing an /etc/init/newrelic.conf script. Sorry if I missunderstood your comments if it's not what you meant.</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Finally, there's no trace of newrelic logs in /var/log/ besides /newrelic/ folder where OTHER newrelic agents does write their logs in this vm.</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">The only logs I have are the ones written in /messages.log</div><div class="gmail_default" style="font-family:tahoma,sans-serif">
<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Thanks again!</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 17 February 2014 12:40, Clint Byrum <span dir="ltr"><<a href="mailto:clint@fewbar.com" target="_blank">clint@fewbar.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Excerpts from Mariano González's message of 2014-02-17 06:43:16 -0800:<br>
<div><div class="h5">> Hi guys.<br>
> I'm asking for help to write a script to monitor a newrelic agent.<br>
> Here's what I have now: <a href="https://gist.github.com/marianogg9/9002995" target="_blank">https://gist.github.com/marianogg9/9002995</a><br>
> As you may see, the service won't start and will respawn 10 times. I think<br>
> this is an env issue, but I tried with export and env stanzas without<br>
> success.<br>
> Any comments will be really appreciated.<br>
> Thanks!<br>
><br>
<br>
</div></div>If you are running it as root, why not have it as a system job from<br>
/etc/init/something.conf ? Then you can drop sudo.<br>
<br>
Also you should have logs in ~/.cache/upstart if it is a user job, or<br>
/var/log/upstart if it is a system job. Those should give a clue as to<br>
why your command is failing.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
upstart-devel mailing list<br>
<a href="mailto:upstart-devel@lists.ubuntu.com">upstart-devel@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/upstart-devel" target="_blank">https://lists.ubuntu.com/mailman/listinfo/upstart-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Mariano Gabriel González</div>
</div>