Issue #1750 - include the qpidd service script in the rpm installations

Change-Id: I8b90e0ffb1c0abc49ba55b55f3085c59e9b902de

Former-commit-id: a07f8076cf [formerly a07f8076cf [formerly 790804146d4eade073e3250e1b1cd95e313b1a96]]
Former-commit-id: 3454fd030b
Former-commit-id: 3dadeb157d
This commit is contained in:
Bryan Kowal 2013-03-25 16:52:33 -05:00 committed by Steve Harris
parent 321b0dd55d
commit 879b3bc84e
2 changed files with 2 additions and 174 deletions

View file

@ -1,172 +0,0 @@
#!/bin/bash
#
# awips2-qpid This script will start and stop the AWIPS II
# Qpid instance.
# description: Qpid 0.18
# processname: qpid-server
# config: /awips2/qpid/etc/config.xml
# Source function library
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
_QPID_USER="awips"
_QPID_SERVER=qpid-server
_QPID_STOPALL=qpid.stopall
JAVA_INSTALL="/awips2/java"
QPID_INSTALL="/awips2/qpid"
_QPID_LOG_DIRECTORY="${QPID_INSTALL}/log"
if [ ! -d ${_QPID_LOG_DIRECTORY} ]; then
mkdir -p ${_QPID_LOG_DIRECTORY}
chown -R ${_QPID_USER}:fxalpha ${_QPID_LOG_DIRECTORY}
fi
_CURRENT_DATE=`date +"%Y%m%d"`
_START_QPID_LOG="${_QPID_LOG_DIRECTORY}/start-qpid-${_CURRENT_DATE}.log"
# default path
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# add AWIPS II java to the path
export JAVA_HOME=${JAVA_INSTALL}
export PATH=${JAVA_INSTALL}/bin:$PATH
export LD_LIBRARY_PATH=${JAVA_INSTALL}/lib
# add AWIPS II qpid to the path
export PATH=${QPID_INSTALL}/bin:$PATH
# set QPID_HOME
export QPID_HOME=${QPID_INSTALL}
function startQPID()
{
# first, verify that qpid is not already running
statusQPID > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "QPID is already running."
statusQPID
return 1
fi
# qpid is not running
# prepare to start qpid
echo -n "Starting QPID"
nohup su ${_QPID_USER} -c "/bin/bash ${_QPID_SERVER} >> ${_START_QPID_LOG} 2>&1" > /dev/null &
if [ $? -ne 0 ]; then
# failed to start the qpid server
failure
echo
return 1
fi
# give qpid time to start
sleep 10
# verify that qpid has started and is still running
statusQPID > /dev/null 2>&1
if [ $? -eq 0 ]; then
success
echo
return 0
else
failure
echo
return 1
fi
}
function stopQPID()
{
# first, verify that qpid is running
statusQPID > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "QPID is not running."
return 1
fi
# prepare to stop qpid
echo -n "Stopping QPID"
nohup su ${_QPID_USER} -c "/bin/bash ${_QPID_STOPALL}" > /dev/null 2>&1
if [ $? -ne 0 ]; then
failure
return 1
fi
# give qpid time to stop
sleep 10
# verify that qpid has stopped
statusQPID > /dev/null 2>&1
if [ $? -eq 0 ]; then
# the shutdown was not successful
failure
echo
return 1
else
# the shutdown was was successful
success
echo
return 0
fi
}
function restartQPID()
{
stopQPID
if [ $? -ne 0 ]; then
return 1
fi
startQPID
return $?
}
function statusQPID()
{
# attempt to retrieve the qpid pid from the process table
pid=`ps aux | grep [j]ava\ -server\ -DPNAME=QPBRKR | grep [o]rg.apache.qpid.server.Main | awk '{print $2}'`
if [ $? -ne 0 ]; then
echo "Failed to determine the status of QPID!"
return 1
fi
if [ "${pid}" = "" ]; then
echo "QPID is not running."
return 1
else
echo "QPID is running with pid ... ${pid}."
fi
return 0
}
# determine which command was executed
_command=${1}
case ${_command} in
start)
startQPID
returnCode=$?
;;
stop)
stopQPID
returnCode=$?
;;
restart)
echo "Restarting QPID"
restartQPID
returnCode=$?
;;
status)
statusQPID
returnCode=$?
;;
*)
# display usage message
echo "Usage: $0 {start|stop|restart|status}" 1>&2
exit 1
;;
esac
exit ${returnCode}

View file

@ -17,7 +17,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
Source2: %{qpid_deps_src_dir}.tar.gz
+ Source3: config.xml
+ Source4: virtualhosts.xml
+ Source5: awips2-qpid
+ Source5: qpidd
Patch0: mrg.patch
Patch1: examples.patch
@ -253,7 +253,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
! %dir /awips2/qpid/etc
! /awips2/qpid/etc/*
! %defattr(755,root,root,755)
! /etc/init.d/awips2-qpid
! /etc/init.d/qpidd
%files example
! %defattr(-,awips,fxalpha,-)