Commit 858bbe4b authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

More work in RHX.



git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/branches/3_3_1_branch@8180 b35dd754-fafc-0310-a699-88a17e54d16e
parent 66a9d6f6
#!/bin/sh
#
# openfired Stops and starts the Openfire XMPP service.
# openfire Stops and starts the Openfire XMPP service.
#
# chkconfig: 2345 99 1
# description: Openfire is an XMPP server, which is a server that facilitates \
# XML based communication, such as chat.
# config: /opt/openfire/conf/openfire.xml
# config: /etc/sysconfig/openfired
# config: /usr/local/openfire/conf/openfire.xml
# config: /etc/sysconfig/openfire
# pidfile: /var/run/openfire.pid
#
# This script has currently been tested on Redhat, CentOS, and Fedora based
......@@ -25,24 +25,26 @@ RETVAL=0
[ "`id -u`" = 0 ] || exit 1
# Get config.
[ -f "/etc/sysconfig/openfired" ] && . /etc/sysconfig/openfired
[ -f "/etc/sysconfig/openfire" ] && . /etc/sysconfig/openfire
# If openfire user is not set in sysconfig, set to daemon.
[ -z "$OPENFIRE_USER" ] && OPENFIRE_USER="daemon"
# If pid file path is not set in sysconfig, set to /var/run/openfired.pid.
# If pid file path is not set in sysconfig, set to /var/run/openfire.pid.
[ -z "$OPENFIRE_PIDFILE" ] && OPENFIRE_PIDFILE="/var/run/${PROG}.pid"
# -----------------------------------------------------------------
# If a openfire home variable has not been specified, try to determine it.
if [ -z "$OPENFIRE_HOME" -o ! -d "$OPENFIRE_HOME" ]; then
if [ -d "/opt/openfire" ]; then
OPENFIRE_HOME="/opt/openfire"
if [ -d "/usr/share/openfire" ]; then
OPENFIRE_HOME="/usr/share/openfire"
elif [ -d "/usr/local/openfire" ]; then
OPENFIRE_HOME="/usr/local/openfire"
elif [ -d "/opt/openfire" ]; then
OPENFIRE_HOME="/opt/openfire"
else
echo "Could not find Openfire installation under /opt or /usr/local."
echo "Could not find Openfire installation under /opt, /usr/share, or /usr/local."
echo "Please specify the Openfire installation location as variable OPENFIRE_HOME"
echo "in /etc/sysconfig/openfire."
exit 1
......@@ -56,6 +58,8 @@ fi
if [ -z "$JAVA_HOME" ]; then
if [ -d "${OPENFIRE_HOME}/jre" ]; then
JAVA_HOME="${OPENFIRE_HOME}/jre"
elif [ -d "/etc/alternatives/jre" ]; then
JAVA_HOME="${OPENFIRE_HOME}/jre"
else
jdks=`ls -r1d /usr/java/j*`
for jdk in $jdks; do
......@@ -115,7 +119,7 @@ start() {
echo
[ $RETVAL -eq 0 -a -d /var/lock/subsys ] && touch /var/lock/subsys/openfired
[ $RETVAL -eq 0 -a -d /var/lock/subsys ] && touch /var/lock/subsys/openfire
sleep 1 # allows prompt to return
cd $OLD_PWD
......@@ -130,7 +134,7 @@ stop() {
echo
[ $RETVAL -eq 0 -a -f "$OPENFIRE_PIDFILE" ] && rm -f $OPENFIRE_PIDFILE
[ $RETVAL -eq 0 -a -f "/var/lock/subsys/openfired" ] && rm -f /var/lock/subsys/openfired
[ $RETVAL -eq 0 -a -f "/var/lock/subsys/openfire" ] && rm -f /var/lock/subsys/openfire
}
restart() {
......@@ -140,7 +144,7 @@ restart() {
}
condrestart() {
[ -e "/var/lock/subsys/openfired" ] && restart
[ -e "/var/lock/subsys/openfire" ] && restart
return 0
}
......
# Set this to the path where openfire lives.
# If this is not set the script will look for /opt/openfire, then
# /usr/local/openfire.
# If this is not set the script will look for /usr/local/openfire, then
# /opt/openfire.
#OPENFIRE_HOME=""
# If there is a different user you would like to run openfire as,
......@@ -9,7 +9,7 @@
# If you wish to change the location of the openfire pid file,
# change the following line.
#OPENFIRE_PIDFILE="/var/run/openfired.pid"
#OPENFIRE_PIDFILE="/var/run/openfire.pid"
# If you wish to explictly specific the location of the log directory,
# you can set it here. Note that this applies to the logs generated outside
......
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