Commit 55bf232a authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Applying some RPM work from earlier in the week. (and testing svn access)

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@7924 b35dd754-fafc-0310-a699-88a17e54d16e
parent df699671
...@@ -5,3 +5,7 @@ ...@@ -5,3 +5,7 @@
# 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,
# change the following line # change the following line
#OPENFIRE_USER="jive" #OPENFIRE_USER="jive"
# If you wish to change the location of the openfire pid file,
# change the following line
#OPENFIRE_PIDFILE="/var/run/openfired.pid"
#!/bin/sh #!/bin/bash
#
# openfired stops and starts the openfire XMPP service # openfired Stops and starts the Openfire XMPP service.
# #
# chkconfig: 2345 99 1 # chkconfig: 2345 99 1
# description: Used to start and stop the openfire XMPP server # description: Openfire is an XMPP server, which is a server that facilitates \
# XML based communication, such as chat.
# config: /opt/openfire/conf/openfire.xml
# pidfile: /var/run/openfired.pid
# #
# Script used to start openfire as daemon # This script has currently been tested on Redhat and CentOS based systems,
# The script has currently been tested on Redhat Fedora Core 3,
# but should theoretically work on most UNIX like systems # but should theoretically work on most UNIX like systems
# #
# before running this script make sure $OPENFIRE_HOME/bin/openfire.sh is # Before running this script make sure $OPENFIRE_HOME/bin/openfire.sh is
# executable by the user you want to run openfire as # executable by the user you want to run openfire as
# (chmod +x $OPENFIRE_HOME/bin/openfire.sh) # (chmod +x $OPENFIRE_HOME/bin/openfire.sh)
# #
...@@ -24,11 +26,14 @@ ...@@ -24,11 +26,14 @@
# #
# Get config. # Get config.
test -f /etc/sysconfig/openfire && . /etc/sysconfig/openfire [ -f /etc/sysconfig/openfire ] && . /etc/sysconfig/openfire
# If openfire user is not set in sysconfig, set to jive. # If openfire user is not set in sysconfig, set to jive.
[ -z "$OPENFIRE_USER" ] && OPENFIRE_USER=jive [ -z "$OPENFIRE_USER" ] && OPENFIRE_USER=jive
# If pid file path is not set in sysconfig, set to /var/run/openfired.pid.
[ -z "$OPENFIRE_PIDFILE" ] && OPENFIRE_PIDFILE=/var/run/openfired.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
...@@ -44,23 +49,42 @@ if [ ! $OPENFIRE_HOME ]; then ...@@ -44,23 +49,42 @@ if [ ! $OPENFIRE_HOME ]; then
fi fi
fi fi
RETVAL=0
prog="openfired"
function execCommand() { start() {
OLD_PWD=`pwd` OLD_PWD=`pwd`
cd $OPENFIRE_HOME/bin cd $OPENFIRE_HOME/bin
CMD="./openfire.sh $1"
su -c "$CMD" $OPENFIRE_USER & # Start daemons.
echo -n $"Starting $prog: "
CMD=./openfire.sh
su -s /bin/bash -c "$CMD" $OPENFIRE_USER &
RETVAL=$?
if [ $RETVAL -eq 0 -a ! -z "$OPENFIRE_PIDFILE" ]; then
echo $! > $OPENFIRE_PIDFILE
fi
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/openfired
sleep 1 # allows prompt to return sleep 1 # allows prompt to return
cd $OLD_PWD cd $OLD_PWD
} }
stop() {
# Stop daemons.
echo -n $"Shutting down $prog: "
start() { [ -f $OPENFILE_PIDFILE ] && kill `cat $OPENFIRE_PIDFILE`
execCommand "start" RETVAL=$?
} echo
stop() { [ $RETVAL -eq 0 -a -f $OPENFIRE_PIDFILE ] && rm -f $OPENFIRE_PIDFILE
execCommand "stop" [ $RETVAL -eq 0 -a -f /var/lock/subsys/openfired ] && rm -f /var/lock/subsys/openfired
} }
......
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