Bug 589259 - Request the agent setup class to check if the agent is in the background
Request the agent setup class to check if the agent is in the background
Status: CLOSED WONTFIX
Product: RHQ Project
Classification: Other
Component: Agent (Show other bugs)
1.3.1
All Linux
medium Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-05 13:05 EDT by dsteigne
Modified: 2014-05-29 13:45 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-05-29 13:45:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description dsteigne 2010-05-05 13:05:51 EDT
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 14:29:42 EDT
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 13:45:29 EDT
Not sure if this is still a problem but closing due to low prio and inactivity.

Note You need to log in before you can comment on or make changes to this bug.