Bug 589259 - Request the agent setup class to check if the agent is in the background
Summary: Request the agent setup class to check if the agent is in the background
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: RHQ Project
Classification: Other
Component: Agent
Version: 1.3.1
Hardware: All
OS: Linux
medium
medium vote
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-05 17:05 UTC by dsteigne
Modified: 2018-11-26 17:30 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-05-29 17:45:29 UTC


Attachments (Terms of Use)

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.


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