Commit 171c364d authored by Daryl Herzmann's avatar Daryl Herzmann Committed by akrherz

OF-753 improve redhat init script logic with PID file

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13985 b35dd754-fafc-0310-a699-88a17e54d16e
parent b5f4139e
...@@ -133,6 +133,10 @@ start() { ...@@ -133,6 +133,10 @@ start() {
[ $RETVAL -eq 0 -a -d /var/lock/subsys ] && touch /var/lock/subsys/openfire [ $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
PID=$(findPID)
echo $PID > $OPENFIRE_PIDFILE
cd $OLD_PWD cd $OLD_PWD
} }
...@@ -140,18 +144,16 @@ stop() { ...@@ -140,18 +144,16 @@ stop() {
# Stop daemons. # Stop daemons.
echo -n "Shutting down openfire: " echo -n "Shutting down openfire: "
PID=$(findPID) if [ -f "$OPENFIRE_PIDFILE" ]; then
if [ -n "$PID" ]; then killproc -p $OPENFIRE_PIDFILE -d 10
if [ -n "$FUNCTIONS_FOUND" ]; then rm -f $OPENFIRE_PIDFILE
echo $PID > $OPENFIRE_PIDFILE else
# delay copied from restart PID=$(findPID)
killproc -p $OPENFIRE_PIDFILE -d 10 if [ -n $PID ]; then
rm -f $OPENFIRE_PIDFILE
else
kill $PID kill $PID
else
echo "Openfire is not running."
fi fi
else
echo "Openfire is not running."
fi fi
RETVAL=$? RETVAL=$?
......
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