[rhq] Branch 'release/jon3.1.x' - modules/enterprise

snegrea snegrea at fedoraproject.org
Mon Aug 20 10:33:02 UTC 2012


 modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh |   40 +++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

New commits:
commit 97178358504e3807d4f8ce65fbd7a56b3bb24048
Author: Stefan Negrea <snegrea at redhat.com>
Date:   Mon Aug 20 05:32:44 2012 -0500

    [BZ 841684] Add config option to the wrapper script.
    (cherry picked from commit c62b143dd5f065b54caf6692d3c04929d8b4539f)

diff --git a/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh b/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh
index 68d1856..f03c83a 100755
--- a/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh
+++ b/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh
@@ -246,6 +246,44 @@ case "$1" in
         fi
         ;;
 
+'config')
+        prepare_pid_dir
+
+        if [ "$_RUNNING" = "1" ]; then
+           echo "Cannot run config - please stop the agent before running config"
+           echo $_STATUS
+           exit 0
+        fi
+
+        echo "Configure RHQ Agent..."
+
+        # Determine the command to execute when starting the agent
+        if [ -z "$RHQ_AGENT_START_COMMAND" ]; then
+           # Find out where the agent start script is located
+           _START_SCRIPT="${RHQ_AGENT_HOME}/bin/rhq-agent.sh"
+
+           if [ ! -f "$_START_SCRIPT" ]; then
+              echo "ERROR! Cannot find the RHQ Agent start script"
+              echo "Not found: $_START_SCRIPT"
+              exit 1
+           fi
+           debug_wrapper_msg "Start script found here: $_START_SCRIPT"
+
+           RHQ_AGENT_START_COMMAND="${_START_SCRIPT}"
+        fi
+
+        RHQ_AGENT_CMDLINE_OPTS="--cleanconfig --nostart --daemon --setup --advanced"
+        export RHQ_AGENT_CMDLINE_OPTS
+
+        # start the agent now!
+        if [ -n "$RHQ_AGENT_DEBUG" ] && [ "$RHQ_AGENT_DEBUG" != "false" ]; then
+           debug_wrapper_msg "Executing agent with command: ${RHQ_AGENT_START_COMMAND} ${RHQ_AGENT_CMDLINE_OPTS}"
+        fi
+
+        . $RHQ_AGENT_START_COMMAND
+
+        ;;
+
 'stop')
         prepare_pid_dir
 
@@ -326,7 +364,7 @@ case "$1" in
         exit $? 
         ;;
 *)
-        echo "Usage: $0 { start | stop | kill | restart | status }"
+        echo "Usage: $0 { start | stop | kill | restart | status | config }"
         exit 1
         ;;
 esac




More information about the rhq-commits mailing list