Opened 9 years ago

Closed 9 years ago

#739 closed defect (fixed)

init script for newrelic agent fails to find running daemon

Reported by: Jo Rhett Owned by:
Priority: minor Milestone:
Component: other Version: 1.7.x
Keywords: Cc: jo@…
uname -a: Linux nginx-web03 3.14.20-20.44.amzn1.x86_64 #1 SMP Mon Oct 6 22:52:46 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.7.7 (nginx-plus-r5)

Description

The init script for nginx-nr-agent can't tell that the agent is running, and tries to restart it every time.

# service nginx-nr-agent status 
nginx-nr-agent dead but subsys locked

# cat /var/run/nginx-nr-agent/nginx-nr-agent.pid 
9167

# ps auwx |grep 9167 
nobody 9167 0.0 0.1 194964 8596 ? S 15:07 0:00 python /usr/bin/nginx-nr-agent.py -p /var/run/nginx-nr-agent/nginx-nr-agent.pid start

This is due to how status is called. It is using the status routine from /etc/init.d/functions without passing in a pidfile. By default status expects the pidfile to be the /var/run/(progname).pid

local pid_file=${2:-/var/run/$base.pid}

The file is trivially simple:

--- /etc/init.d/nginx-nr-agent	2014-10-31 15:00:14.000000000 -0700 
+++ /tmp/nginx-nr-agent	2015-03-31 15:21:26.491191426 -0700 
@@ -101,7 +101,7 @@ 
RETVAL=$? 
;; 
status) 
- status nginx-nr-agent 
+ status -p $pidfile nginx-nr-agent 
RETVAL=$? 
;; 
configtest)

Change History (1)

comment:1 by Andrei Belov, 9 years ago

Resolution: fixed
Status: newclosed

This was already fixed in the 2.0.0-6 version of the nginx-nr-agent package, published on March, 25th.

Note: See TracTickets for help on using tickets.