
|
If you were logged in you would be able to see more operations.
|
|
|
Hyperic HQ
Created: 08/Apr/08 01:25 PM
Updated: 17/Apr/08 06:04 AM
|
|
| Component/s: |
Server
|
| Affects Version/s: |
3.2.2
|
| Fix Version/s: |
4.0.0,
3.2.3
|
|
|
Environment:
|
HQ v3.2.2 on SLES 10 64-bit
|
|
| Verify By: |
Kashyap Parikh
|
| 3.0 Category: |
Scalability & Performance
|
| Last comment: |
25 weeks, 4 days ago
|
| Resolution Date: |
09/Apr/08 12:36 PM
|
|
The method in hq-server.sh for obtaining the value of server.java.opts in hq-server.conf is broken. Specifically, the sourcing of the TMPPROPFILE fails because the value of server.java.opts contains spaces. This failure ensures that no configuration changes to this option are ever picked up by the server.
The original function:
# Load JAVA_OPTS. Changes to this file will be lost on server upgrades. To set this
# value permanently, set server.java.opts in conf/hq-server.conf
loadJavaOpts () {
TMPPROPFILE="${SERVER_HOME}/logs/.hq-server.conf.tmp"
cat ${SERVER_HOME}/conf/hq-server.conf | grep server\.java\.opts | grep -v "^#" | sed 's/\./_/g' > ${TMPPROPFILE}
. ${TMPPROPFILE} 2> /dev/null
rm -f ${TMPPROPFILE}
if [ "x${server_java_opts}" = "x" ] ; then
echo "-XX:MaxPermSize=192m -Xmx512m -Xms512m"
fi
echo "${server_java_opts}"
}
Suggested replacement:
loadJavaOpts () {
server_java_opts=`grep ^[ ]*server\.java\.opts ${SERVER_HOME}/conf/hq-server.conf | sed 's/[ ]*server\.java\.opts=//'`
if [ -z "${server_java_opts}" ]; then
echo "-XX:MaxPermSize=192m -Xmx512m -Xms512m"
fi
echo "${server_java_opts}"
}
Note that the contents of the [ ] in the grep and sed commands above would be both a single space and a single tab (insert the tab with <ctrl-v>, then hitting tab key). This searches for any line with zero or more whitespace, followed by the server.java.opts line. This eliminates having to then "grep -v" any matches that are commented out (with a #), and matches any lines that a careless admin would have inserted with leading whitespace. Sed correspondingly looks for any leading whitespace so it can be discarded.
I also cleaned up the if test to register true for zero-length ${server_java_opts}.
All suggested code above tested under bash and ksh on Linux and AIX.
|
|
Description
|
The method in hq-server.sh for obtaining the value of server.java.opts in hq-server.conf is broken. Specifically, the sourcing of the TMPPROPFILE fails because the value of server.java.opts contains spaces. This failure ensures that no configuration changes to this option are ever picked up by the server.
The original function:
# Load JAVA_OPTS. Changes to this file will be lost on server upgrades. To set this
# value permanently, set server.java.opts in conf/hq-server.conf
loadJavaOpts () {
TMPPROPFILE="${SERVER_HOME}/logs/.hq-server.conf.tmp"
cat ${SERVER_HOME}/conf/hq-server.conf | grep server\.java\.opts | grep -v "^#" | sed 's/\./_/g' > ${TMPPROPFILE}
. ${TMPPROPFILE} 2> /dev/null
rm -f ${TMPPROPFILE}
if [ "x${server_java_opts}" = "x" ] ; then
echo "-XX:MaxPermSize=192m -Xmx512m -Xms512m"
fi
echo "${server_java_opts}"
}
Suggested replacement:
loadJavaOpts () {
server_java_opts=`grep ^[ ]*server\.java\.opts ${SERVER_HOME}/conf/hq-server.conf | sed 's/[ ]*server\.java\.opts=//'`
if [ -z "${server_java_opts}" ]; then
echo "-XX:MaxPermSize=192m -Xmx512m -Xms512m"
fi
echo "${server_java_opts}"
}
Note that the contents of the [ ] in the grep and sed commands above would be both a single space and a single tab (insert the tab with <ctrl-v>, then hitting tab key). This searches for any line with zero or more whitespace, followed by the server.java.opts line. This eliminates having to then "grep -v" any matches that are commented out (with a #), and matches any lines that a careless admin would have inserted with leading whitespace. Sed correspondingly looks for any leading whitespace so it can be discarded.
I also cleaned up the if test to register true for zero-length ${server_java_opts}.
All suggested code above tested under bash and ksh on Linux and AIX. |
Show » |
|