Commit 55236937 authored by akrherz's avatar akrherz

OF-746 further improvements to debian init script and defaults file to

help locate JAVA_HOME
parent 3442ecf2
...@@ -6,5 +6,9 @@ ...@@ -6,5 +6,9 @@
# This is a POSIX shell fragment # This is a POSIX shell fragment
# #
# If you wish to override the auto-detected JAVA_HOME variable, uncomment
# and change the following line.
#JAVA_HOME=/usr/java/default
# Additional options that are passed to the Daemon. # Additional options that are passed to the Daemon.
DAEMON_OPTS="" DAEMON_OPTS=""
...@@ -19,13 +19,17 @@ ...@@ -19,13 +19,17 @@
# Description: Start/stop openfire jabber server # Description: Start/stop openfire jabber server
### END INIT INFO ### END INIT INFO
# Include openfire defaults if available
if [ -f /etc/default/openfire ] ; then
. /etc/default/openfire
fi
# Attempt to locate JAVA_HOME # Attempt to locate JAVA_HOME
if [ -z $JAVA_HOME ]; then if [ -z $JAVA_HOME ]; then
JAVA_HOME=$(LC_ALL=C update-alternatives --display java \ JAVA_HOME=$(LC_ALL=C update-alternatives --display java \
| grep best \ | grep best \
| grep -oe \/.*\/bin\/java \ | grep -oe \/.*\/bin\/java \
| sed 's/\/jre\/.*//g') | sed 's/\/bin\/java//g')
echo "best java alternative in: "$JAVA_HOME echo "best java alternative in: "$JAVA_HOME
fi fi
...@@ -38,11 +42,6 @@ DAEMON_LIB=${DAEMON_DIR}/lib ...@@ -38,11 +42,6 @@ DAEMON_LIB=${DAEMON_DIR}/lib
test -x $JAVA || exit 1 test -x $JAVA || exit 1
# Include openfire defaults if available
if [ -f /etc/default/openfire ] ; then
. /etc/default/openfire
fi
DAEMON_OPTS="$DAEMON_OPTS -server -DopenfireHome=${DAEMON_DIR} \ DAEMON_OPTS="$DAEMON_OPTS -server -DopenfireHome=${DAEMON_DIR} \
-Dopenfire.lib.dir=${DAEMON_LIB} -classpath ${DAEMON_LIB}/startup.jar\ -Dopenfire.lib.dir=${DAEMON_LIB} -classpath ${DAEMON_LIB}/startup.jar\
-jar ${DAEMON_LIB}/startup.jar" -jar ${DAEMON_LIB}/startup.jar"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment