From 21fa510eaa3cea777ddbae141ea8af0755beb645 Mon Sep 17 00:00:00 2001 From: Bryan Kowal Date: Mon, 25 Mar 2013 16:52:33 -0500 Subject: [PATCH] Issue #1750 - include the qpidd service script in the rpm installations Change-Id: I8b90e0ffb1c0abc49ba55b55f3085c59e9b902de Former-commit-id: c96c45074c220140b8774e1fceeab2b79820f033 --- rpms/awips2.qpid/0.18/SOURCES/awips2-qpid | 172 ------------------ .../0.18/SPECS/qpid-java.spec.patch0 | 4 +- 2 files changed, 2 insertions(+), 174 deletions(-) delete mode 100644 rpms/awips2.qpid/0.18/SOURCES/awips2-qpid diff --git a/rpms/awips2.qpid/0.18/SOURCES/awips2-qpid b/rpms/awips2.qpid/0.18/SOURCES/awips2-qpid deleted file mode 100644 index 2f839cf07c..0000000000 --- a/rpms/awips2.qpid/0.18/SOURCES/awips2-qpid +++ /dev/null @@ -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} diff --git a/rpms/awips2.qpid/0.18/SPECS/qpid-java.spec.patch0 b/rpms/awips2.qpid/0.18/SPECS/qpid-java.spec.patch0 index 7da160fb8d..1b18ebe1f7 100644 --- a/rpms/awips2.qpid/0.18/SPECS/qpid-java.spec.patch0 +++ b/rpms/awips2.qpid/0.18/SPECS/qpid-java.spec.patch0 @@ -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 @@ -247,7 +247,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,-)