Bug 843419

Summary: [Agent RPM] PID for both EC2 and non-EC2 agents are being created and both agents can be started together.
Product: [Other] RHQ Project Reporter: Armine Hovsepyan <ahovsepy>
Component: AgentAssignee: Stefan Negrea <snegrea>
Status: CLOSED WONTFIX QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 4.5CC: hrupp, mfoley, snegrea
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-30 15:22:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 707235    
Attachments:
Description Flags
2_pid none

Description Armine Hovsepyan 2012-07-26 09:38:37 UTC
Description of problem:
It is possible to start two Agents - one regular and one ec2 specific and both do create PID files and processes.

Version-Release number of selected component (if applicable):
jboss-on-agent-3.1.0.GA-8.el6_3.noarch.rpm 
jboss-on-agent-init-ec2-3.1.0.GA-8.el6_3.noarch.rpm 
How reproducible:
always

Steps to Reproduce:
1. rpm install jboss-on-agent
2. rpm install jboss-on-agent-init-ec2
3. start jon-agent service
4. start jon-agent-ec2 service
  
Actual results:
both services are being started, 2 pid files are being created: one under /var/run/jboss-on/agent and second under /var/run/jboss-on/agent-ec2.

Expected results:
it is not possible to start both services together

Additional info:
attached screenshot of pid files in directory

Comment 1 Armine Hovsepyan 2012-07-26 09:39:07 UTC
Created attachment 600468 [details]
2_pid

Comment 2 Stefan Negrea 2012-07-30 14:46:05 UTC
This problem only applies to cases where the user purposely starts both services at the same time. There is currently no mechanism in place to prevent an user to start both agents. This is not a problem for normal system life-cycle (eg. system restart). In that case only one agent starts based on the RPMs installed.

For the initial RPM work, there was only one folder that held PIDs for both regular and EC2 agents. That lead to false positives for reporting whether the agent is started. For example, if the EC2 agent was started the regular agent would report as started too. Bug 817100 and bug 816000 resolved this issue however, the side of that is that the user can now start both agents.

Comment 3 Charles Crouch 2012-07-30 15:22:36 UTC
From Stefan's description this is working as expected, given there are no usecases where someone would want to start both agent types at the same time.