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:
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."
Not sure if this is still a problem but closing due to low prio and inactivity.