Skip to content

Commit

Permalink
many fixes in jopr and jopr-agent scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
goldmann committed Aug 14, 2009
1 parent 253a801 commit f78856d
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 8 deletions.
4 changes: 3 additions & 1 deletion appliances/jboss-as5-appliance/jboss-as5-appliance.post
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
/bin/sed "s/-Xmx512m/-Xmx#JBOSS_XMX#m/" -i /opt/jboss-as5/bin/run.conf
/bin/sed "s/-Xms128m/-Xms#JBOSS_XMS#m/" -i /opt/jboss-as5/bin/run.conf
/bin/echo "thin ALL=(ALL) NOPASSWD: /bin/sh, /sbin/service" >> /etc/sudoers
/bin/sed -i s/"Defaults requiretty"/"#Defaults requiretty"/ /etc/sudoers
/bin/sed -i s/"Defaults requiretty"/"#Defaults requiretty"/ /etc/sudoers
/sbin/chkconfig --add jopr-agent
/sbin/chkconfig jopr-agent on
2 changes: 1 addition & 1 deletion appliances/management-appliance/management-appliance.appl
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ packages:
- dhcp
- sudo
- jboss-cloud-management
- java-1.6.0-openjdk
- java-1.6.0-openjdk-devel
- jopr
2 changes: 1 addition & 1 deletion lib/jboss-appliance-support
Submodule jboss-appliance-support updated from 0476a3 to 5931a5
1 change: 1 addition & 0 deletions specs/jopr.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Source2: agent-configuration.xml
Source3: jopr.init
Requires: shadow-utils
Requires: java-1.6.0-openjdk
Requires: unzip
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
AutoReqProv: 0
AutoReq: 0
Expand Down
2 changes: 1 addition & 1 deletion src/jopr-agent-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mkdir -p $JOPR_AGENT_HOME

sleep=0
downloaded=0
while [ $downloaded -eq 1 ]; do
while [ "$downloaded" = "0" ]; do
sleep 5
sleep=`expr $sleep + 5`

Expand Down
8 changes: 7 additions & 1 deletion src/jopr-agent.init
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@
# agent installation.
# =============================================================================

export RHQ_AGENT_JAVA_EXE_FILE_PATH=/usr/lib/jvm/jre-1.6.0/bin/java
export RHQ_AGENT_HOME=/opt/jopr-agent/rhq-agent

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

# if Jopr server ip isn't injected, don't start the agent
[ "x$JOPR_SERVER_IP" = "x" ] && exit 0
if [ "x$JOPR_SERVER_IP" = "x" ]; then
echo "No JOPR_SERVER_IP specified..."
exit 0
fi

# ----------------------------------------------------------------------
# Function that simply dumps a message iff debug mode is enabled
Expand Down
18 changes: 15 additions & 3 deletions src/jopr.init
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,13 @@
# 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/

# lets preconfigure Jopr Agent
/usr/share/jopr/preconfigure-jopr-agent.sh > /opt/jopr/agent-preconfigure.log
[ -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

# ----------------------------------------------------------------------
# Make sure we unset any lingering JBossAS environment variables that
Expand All @@ -95,6 +100,13 @@ 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 @@ -356,9 +368,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
"$_JBOSS_RUN_SCRIPT" $RHQ_SERVER_CMDLINE_OPTS &
$SU - $RHQ_SERVER_USER -s /bin/sh -c "$_JBOSS_RUN_SCRIPT $RHQ_SERVER_CMDLINE_OPTS" &
else
"$_JBOSS_RUN_SCRIPT" $RHQ_SERVER_CMDLINE_OPTS > /dev/null 2>&1 &
$SU - $RHQ_SERVER_USER -s /bin/sh -c "$_JBOSS_RUN_SCRIPT $RHQ_SERVER_CMDLINE_OPTS" > /dev/null 2>&1 &
fi

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

0 comments on commit f78856d

Please sign in to comment.