Bug 446955

Summary: Running "qpidd -c" gives the wrong answer for qpidd run from service
Product: Red Hat Enterprise MRG Reporter: Andrew Stitcher <astitcher>
Component: qpid-cppAssignee: Ted Ross <tross>
Status: CLOSED CURRENTRELEASE QA Contact: Kim van der Riet <kim.vdriet>
Severity: medium Docs Contact:
Priority: urgent    
Version: beta   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-12-02 16:06:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrew Stitcher 2008-05-16 18:53:37 UTC
Description of problem:

If you start qpidd as a service using "sudo /sbin/service qpidd start" then
running "sudo /usr/sbin/qpidd -c" gives the output:
Exception: Cannot open /var/run/qpidd.5672.pid: No such file or directory
to stderr. Even though qpidd is actually running according to ps

"sudo /sbin/service qpidd status" gives the correct result though.

Version-Release number of selected component (if applicable):

qpidd-0.2.656926-1.el5

How reproducible:

Repeatable

Comment 1 Ted Ross 2008-05-19 20:47:45 UTC
The reason this happens is that qpidd uses /var/run if running as root and /tmp
if not running as root.  When the service is started, the daemon is started
under user "qpidd", thus the pid is stored in /tmp/qpidd.5672.pid.  Then "qpidd
-c" is run directly under sudo, it is root and looks in /var/run/qpidd.5672.pid
and fails.


Comment 2 Carl Trieloff 2008-05-21 13:48:53 UTC
turn this off by default / rip it out.

Comment 3 Carl Trieloff 2008-05-21 13:50:51 UTC

Add a option that specifies that we want a pid file and where to write it.

Comment 4 Jeff Needle 2008-05-22 19:25:34 UTC
Since this is called from the rhmd init script, this keeps the service from
starting:

[root@dhcp-10-16-61-243 ~]# service rhmd start
Starting RHM daemon:                                       [  OK  ]
Exception: Cannot open /tmp/qpidd.5672.pid: No such file or directory

[root@dhcp-10-16-61-243 ~]# service rhmd status
rhmd is stopped

bumping priority

Comment 5 Jeff Needle 2008-05-22 19:26:37 UTC
Oh, the above was on RHEL4, by the way.  Fresh install, packages added from BT4
RHEL4 repository on webqa.

Comment 6 Mike Bonnet 2008-06-20 03:51:39 UTC
qpidc-0.2.667603-1.el5, qpidc-perftest-0.2.667603-1.el5, qpidd-0.2.667603-1.el5, and rhm-0.2.2153-1.el5 have been pushed to the staging repo for testing