Bug 589259

Summary: Request the agent setup class to check if the agent is in the background
Product: [Other] RHQ Project Reporter: dsteigne
Component: AgentAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED WONTFIX QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.3.1CC: jshaughn, loleary
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: 2014-05-29 17:45:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description dsteigne 2010-05-05 17:05:51 UTC
Description of problem:
Agent setup class should check to see if the agent is in the background. If RHQ_AGENT_IN_BACKGROUND=rhq-agent.pid enabled in rhq-agent-env.sh and you run rhq-agent.sh --cleanconfig, we should throw a meaningful error and terminate the Agent.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Larry O'Leary 2010-05-26 18:29:42 UTC
This is specifically to prevent unexpected Setup utility behavior from occurring in the Agent if configuration is necessary.  Essentially, if the Agent is being executed in the background, we do not have standard input.  This will result in the Agent setup prompt failing when attempting to get input from the user.

FATAL [main] (org.rhq.enterprise.agent.AgentMain)- {AgentMain.start-failure}Failed to start the agent
java.lang.NullPointerException
at org.rhq.enterprise.communications.util.prefs.Setup.prompt(Setup.java:303)
at org.rhq.enterprise.communications.util.prefs.Setup.setup(Setup.java:193)
at org.rhq.enterprise.agent.promptcmd.SetupPromptCommand.performBasicSetup(SetupPromptCommand.java:106)
at org.rhq.enterprise.agent.AgentMain.main(AgentMain.java:399)



Instead, we should check to see if stdin is available and if so, continue on (if not in the background).  Otherwise, we should print to stderr some meaningful message saying "Agent configuration required.  You must start the Agent in interactive mode."

Comment 4 Jay Shaughnessy 2014-05-29 17:45:29 UTC
Not sure if this is still a problem but closing due to low prio and inactivity.