Skip to content

Commit

Permalink
fix in jopr and jopr-agent init files, now it should work
Browse files Browse the repository at this point in the history
  • Loading branch information
goldmann committed Aug 20, 2009
1 parent 5678b3a commit ab32242
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
2 changes: 2 additions & 0 deletions src/jopr-agent.init
Expand Up @@ -28,6 +28,8 @@ export RHQ_AGENT_HOME=/opt/jopr-agent/rhq-agent

[ -f /etc/sysconfig/jopr-agent ] && . /etc/sysconfig/jopr-agent

[ ! -d $RHQ_AGENT_HOME ] && /usr/share/jopr-agent/jopr-agent-install.sh

# if Jopr server ip isn't injected, don't start the agent
if [ "x$JOPR_SERVER_IP" = "x" ]; then
echo "No JOPR_SERVER_IP specified..."
Expand Down
20 changes: 5 additions & 15 deletions src/jopr.init
Expand Up @@ -81,12 +81,11 @@
# RHQ_SERVER_ADDITIONAL_JAVA_OPTS=additional VM options
# RHQ_SERVER_CMDLINE_OPTS=additional run.sh options

RHQ_SERVER_USER=jopr
RHQ_SERVER_HOME=/opt/jopr
RHQ_AGENT_VERSION=1.2.1
JAVA_HOME=/usr/lib/jvm/java-1.6.0/
RHQ_SERVER_HOME=/opt/jopr
RHQ_SERVER_JAVA_HOME=/usr/lib/jvm/java-1.6.0/

# lets preconfigure Jopr Agent
# preconfigure Jopr Agent
[ -f $RHQ_SERVER_HOME/jbossas/server/default/deploy/rhq.ear.rej/rhq-downloads/rhq-agent/rhq-enterprise-agent-$RHQ_AGENT_VERSION.jar ] && /usr/share/jopr/preconfigure-jopr-agent.sh > /opt/jopr/agent-preconfigure.log

# ----------------------------------------------------------------------
Expand All @@ -100,13 +99,6 @@ unset RUN_CONF
unset JAVAC_JAR
unset JBOSS_CLASSPATH

if [ -x /sbin/runuser ]
then
SU=runuser
else
SU=su
fi

# ----------------------------------------------------------------------
# Dumps a message iff debug mode is enabled
# ----------------------------------------------------------------------
Expand Down Expand Up @@ -235,8 +227,6 @@ if [ ! -d "${_LOG_DIR_PATH}" ]; then
mkdir "${_LOG_DIR_PATH}"
fi

chown $RHQ_SERVER_USER:$RHQ_SERVER_USER ${_LOG_DIR_PATH} -R

# ----------------------------------------------------------------------
# Find the Java executable and verify we have a VM available
# ----------------------------------------------------------------------
Expand Down Expand Up @@ -370,9 +360,9 @@ case "$1" in
# start the server, making sure its working directory is the JBossAS bin directory
cd "${RHQ_SERVER_HOME}/jbossas/bin"
if [ "x$RHQ_SERVER_DEBUG" != "x" ] && [ "$RHQ_SERVER_DEBUG" != "false" ]; then
$SU - $RHQ_SERVER_USER -s /bin/sh -c "$_JBOSS_RUN_SCRIPT $RHQ_SERVER_CMDLINE_OPTS" &
"$_JBOSS_RUN_SCRIPT" $RHQ_SERVER_CMDLINE_OPTS &
else
$SU - $RHQ_SERVER_USER -s /bin/sh -c "$_JBOSS_RUN_SCRIPT $RHQ_SERVER_CMDLINE_OPTS" > /dev/null 2>&1 &
"$_JBOSS_RUN_SCRIPT" $RHQ_SERVER_CMDLINE_OPTS > /dev/null 2>&1 &
fi

echo "$!" > "$_SERVER_PIDFILE"
Expand Down

0 comments on commit ab32242

Please sign in to comment.