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