You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jr...@apache.org on 2018/03/14 20:50:42 UTC
[08/14] qpid-cpp git commit: QPID-7999: Move Fedora-specific init
scripts to the fedora dir;
disable their installation, but keep them in the build output so packagers can
pick them up as needed
QPID-7999: Move Fedora-specific init scripts to the fedora dir; disable their installation, but keep them in the build output so packagers can pick them up as needed
Project: http://git-wip-us.apache.org/repos/asf/qpid-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-cpp/commit/88d08be3
Tree: http://git-wip-us.apache.org/repos/asf/qpid-cpp/tree/88d08be3
Diff: http://git-wip-us.apache.org/repos/asf/qpid-cpp/diff/88d08be3
Branch: refs/heads/master
Commit: 88d08be32de9b6233fcad02539b9dcf303e4b16b
Parents: 2fda113
Author: Justin Ross <jr...@apache.org>
Authored: Mon Mar 12 13:49:23 2018 -0700
Committer: Justin Ross <jr...@apache.org>
Committed: Wed Mar 14 10:46:27 2018 -0700
----------------------------------------------------------------------
etc/CMakeLists.txt | 14 +--
etc/cluster.conf-example.xml.in | 90 -----------------
etc/fedora/cluster.conf-example.xml | 90 +++++++++++++++++
etc/fedora/qpidd-primary.in | 113 +++++++++++++++++++++
etc/fedora/qpidd.in | 168 +++++++++++++++++++++++++++++++
etc/qpidd-primary.in | 113 ---------------------
etc/qpidd.in | 168 -------------------------------
7 files changed, 375 insertions(+), 381 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/88d08be3/etc/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/etc/CMakeLists.txt b/etc/CMakeLists.txt
index c39257e..7c4a48b 100644
--- a/etc/CMakeLists.txt
+++ b/etc/CMakeLists.txt
@@ -18,7 +18,6 @@
#
if (UNIX)
-
# Use absolute paths as these are substituted into init scripts.
set_absolute_install_path (bindir ${QPID_INSTALL_BINDIR})
set_absolute_install_path (sysconfdir ${SYSCONF_INSTALL_DIR})
@@ -26,18 +25,13 @@ if (UNIX)
set_absolute_install_path (initdir ${QPID_INSTALL_INITDDIR})
set_absolute_install_path (confdir ${QPID_INSTALL_CONFDIR})
- configure_file(qpidd.in
- ${CMAKE_CURRENT_BINARY_DIR}/qpidd
+ configure_file(fedora/qpidd.in
+ ${CMAKE_CURRENT_BINARY_DIR}/fedora/qpidd
@ONLY)
- configure_file(qpidd-primary.in
- ${CMAKE_CURRENT_BINARY_DIR}/qpidd-primary
+ configure_file(fedora/qpidd-primary.in
+ ${CMAKE_CURRENT_BINARY_DIR}/fedora/qpidd-primary
@ONLY)
-
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qpidd ${CMAKE_CURRENT_BINARY_DIR}/qpidd-primary
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
- DESTINATION ${QPID_INSTALL_INITDDIR}
- COMPONENT ${QPID_COMPONENT_BROKER})
endif (UNIX)
install(FILES qpidc.conf
http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/88d08be3/etc/cluster.conf-example.xml.in
----------------------------------------------------------------------
diff --git a/etc/cluster.conf-example.xml.in b/etc/cluster.conf-example.xml.in
deleted file mode 100644
index d6f0c08..0000000
--- a/etc/cluster.conf-example.xml.in
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-
-<!--
-This is an example of a cluster.conf file to run qpidd HA under rgmanager.
-This example assumes a 3 node cluster, with nodes named node1, node2 and node3.
-
-NOTE: fencing is not shown, it should be configured in a real cluster configuration.
--->
-
-<cluster name="qpid-test" config_version="18">
- <!-- The cluster has 3 nodes. Each has a unique nodid and one vote
- for quorum. -->
- <clusternodes>
- <clusternode name="node1.example.com" nodeid="1"/>
- <clusternode name="node2.example.com" nodeid="2"/>
- <clusternode name="node3.example.com" nodeid="3"/>
- </clusternodes>
- <!-- Resouce Manager configuration. -->
- <rm>
- <!--
- There is a failoverdomain for each node containing just that node.
- This lets us stipulate that the qpidd service should always run on each node.
- -->
- <failoverdomains>
- <failoverdomain name="node1-domain" restricted="1">
- <failoverdomainnode name="node1.example.com"/>
- </failoverdomain>
- <failoverdomain name="node2-domain" restricted="1">
- <failoverdomainnode name="node2.example.com"/>
- </failoverdomain>
- <failoverdomain name="node3-domain" restricted="1">
- <failoverdomainnode name="node3.example.com"/>
- </failoverdomain>
- </failoverdomains>
-
- <resources>
- <!-- This script starts a qpidd broker acting as a backup. -->
- <script file="!!sysconfdir!!/init.d/qpidd" name="qpidd"/>
-
- <!-- This script promotes the qpidd broker on this node to primary. -->
- <script file="!!sysconfdir!!/init.d/qpidd-primary" name="qpidd-primary"/>
-
- <!-- This is a virtual IP address for broker replication traffic. -->
- <ip address="20.0.10.200" monitor_link="1"/>
-
- <!-- This is a virtual IP address on a seprate network for client traffic. -->
- <ip address="20.0.20.200" monitor_link="1"/>
- </resources>
-
- <!-- There is a qpidd service on each node, it should be restarted if it fails. -->
- <service name="node1-qpidd-service" domain="node1-domain" recovery="restart">
- <script ref="qpidd"/>
- </service>
- <service name="node2-qpidd-service" domain="node2-domain" recovery="restart">
- <script ref="qpidd"/>
- </service>
- <service name="node3-qpidd-service" domain="node3-domain" recovery="restart">
- <script ref="qpidd"/>
- </service>
-
- <!-- There should always be a single qpidd-primary service, it can run on any node. -->
- <service name="qpidd-primary-service" autostart="1" exclusive="0" recovery="relocate">
- <script ref="qpidd-primary"/>
- <!-- The primary has the IP addresses for brokers and clients to connect. -->
- <ip ref="20.0.10.200"/>
- <ip ref="20.0.20.200"/>
- </service>
- </rm>
- <fencedevices/>
- <fence_daemon clean_start="0" post_fail_delay="0" post_join_delay="3"/>
-</cluster>
http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/88d08be3/etc/fedora/cluster.conf-example.xml
----------------------------------------------------------------------
diff --git a/etc/fedora/cluster.conf-example.xml b/etc/fedora/cluster.conf-example.xml
new file mode 100644
index 0000000..d6f0c08
--- /dev/null
+++ b/etc/fedora/cluster.conf-example.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<!--
+This is an example of a cluster.conf file to run qpidd HA under rgmanager.
+This example assumes a 3 node cluster, with nodes named node1, node2 and node3.
+
+NOTE: fencing is not shown, it should be configured in a real cluster configuration.
+-->
+
+<cluster name="qpid-test" config_version="18">
+ <!-- The cluster has 3 nodes. Each has a unique nodid and one vote
+ for quorum. -->
+ <clusternodes>
+ <clusternode name="node1.example.com" nodeid="1"/>
+ <clusternode name="node2.example.com" nodeid="2"/>
+ <clusternode name="node3.example.com" nodeid="3"/>
+ </clusternodes>
+ <!-- Resouce Manager configuration. -->
+ <rm>
+ <!--
+ There is a failoverdomain for each node containing just that node.
+ This lets us stipulate that the qpidd service should always run on each node.
+ -->
+ <failoverdomains>
+ <failoverdomain name="node1-domain" restricted="1">
+ <failoverdomainnode name="node1.example.com"/>
+ </failoverdomain>
+ <failoverdomain name="node2-domain" restricted="1">
+ <failoverdomainnode name="node2.example.com"/>
+ </failoverdomain>
+ <failoverdomain name="node3-domain" restricted="1">
+ <failoverdomainnode name="node3.example.com"/>
+ </failoverdomain>
+ </failoverdomains>
+
+ <resources>
+ <!-- This script starts a qpidd broker acting as a backup. -->
+ <script file="!!sysconfdir!!/init.d/qpidd" name="qpidd"/>
+
+ <!-- This script promotes the qpidd broker on this node to primary. -->
+ <script file="!!sysconfdir!!/init.d/qpidd-primary" name="qpidd-primary"/>
+
+ <!-- This is a virtual IP address for broker replication traffic. -->
+ <ip address="20.0.10.200" monitor_link="1"/>
+
+ <!-- This is a virtual IP address on a seprate network for client traffic. -->
+ <ip address="20.0.20.200" monitor_link="1"/>
+ </resources>
+
+ <!-- There is a qpidd service on each node, it should be restarted if it fails. -->
+ <service name="node1-qpidd-service" domain="node1-domain" recovery="restart">
+ <script ref="qpidd"/>
+ </service>
+ <service name="node2-qpidd-service" domain="node2-domain" recovery="restart">
+ <script ref="qpidd"/>
+ </service>
+ <service name="node3-qpidd-service" domain="node3-domain" recovery="restart">
+ <script ref="qpidd"/>
+ </service>
+
+ <!-- There should always be a single qpidd-primary service, it can run on any node. -->
+ <service name="qpidd-primary-service" autostart="1" exclusive="0" recovery="relocate">
+ <script ref="qpidd-primary"/>
+ <!-- The primary has the IP addresses for brokers and clients to connect. -->
+ <ip ref="20.0.10.200"/>
+ <ip ref="20.0.20.200"/>
+ </service>
+ </rm>
+ <fencedevices/>
+ <fence_daemon clean_start="0" post_fail_delay="0" post_join_delay="3"/>
+</cluster>
http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/88d08be3/etc/fedora/qpidd-primary.in
----------------------------------------------------------------------
diff --git a/etc/fedora/qpidd-primary.in b/etc/fedora/qpidd-primary.in
new file mode 100755
index 0000000..86bc76d
--- /dev/null
+++ b/etc/fedora/qpidd-primary.in
@@ -0,0 +1,113 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#
+# qpidd Startup script for the Qpid messaging daemon.
+#
+
+### BEGIN INIT INFO
+# Provides: qpidd-primary
+# Required-Start: $qpidd
+# Required-Stop: $qpidd
+# Default-Start:
+# Default-Stop: 0 1 2 3 4 5 6
+# Short-Description: promote qpidd to cluster primary
+# Description: Qpidd can be run in an active/passive cluster. Promote a running qpidd to primary.
+### END INIT INFO
+
+# chkconfig: - 85 15
+# description: Qpidd can be run in an active/passive cluster. Promote a running qpidd to primary.
+# processname: qpidd
+
+prog=qpidd
+
+# The following variables can be overridden in @sysconfdir@/sysconfig/$prog
+QPID_INIT=@initdir@/$prog
+QPID_CONFIG=@confdir@/qpidd.conf
+QPID_HA=@bindir@/qpid-ha
+QPID_HA_OPTIONS="--config $QPID_CONFIG"
+
+# Source configuration
+test -f @sysconfdir@/sysconfig/$prog && source @sysconfdir@/sysconfig/$prog
+source /etc/rc.d/init.d/functions
+
+# Check presence of executables/scripts
+for f in $QPID_INIT $QPID_HA; do
+ test -x $f || { echo "$f not found or not executable"; exit 5; }
+done
+
+QPID_HA="$QPID_HA $QPID_HA_OPTIONS"
+
+RETVAL=0
+
+status() {
+ if $QPID_HA status --is-primary ; then
+ echo "qpidd is primary"
+ else
+ echo "qpidd is not primary"
+ return 1
+ fi
+}
+
+# Ensure no concurrent start/stop of services.
+lock() {
+ export QPID_HA_LOCK_HELD=1 # For calls to the qpidd script
+ exec 9< $QPID_INIT
+ flock 9
+}
+
+start() {
+ lock
+ $QPID_INIT start primary || return $?
+ echo -n $"Promoting to primary: "
+ err=$($QPID_HA promote --cluster-manager 2>&1)
+ RETVAL=$?
+ [ $RETVAL = 0 ] && success || { echo -n "$err: "; failure; }
+ echo
+ return $RETVAL
+}
+
+stop() {
+ $QPID_INIT stop primary
+}
+
+reload() {
+ echo 1>&2 $"$0: reload not supported"
+ return 3
+}
+
+restart() {
+ stop && start
+}
+
+# See how we were called.
+case "$1" in
+ start|stop|status|restart|reload)
+ $1
+ RETVAL=$?
+ ;;
+ force-reload)
+ restart
+ ;;
+ *)
+ echo 1>&2 $"Usage: $0 {start|stop|status|restart|force-reload}"
+ exit 2
+esac
+
+exit $RETVAL
http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/88d08be3/etc/fedora/qpidd.in
----------------------------------------------------------------------
diff --git a/etc/fedora/qpidd.in b/etc/fedora/qpidd.in
new file mode 100755
index 0000000..d363308
--- /dev/null
+++ b/etc/fedora/qpidd.in
@@ -0,0 +1,168 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#
+# qpidd Startup script for the Qpid messaging daemon.
+#
+
+### BEGIN INIT INFO
+# Provides: qpidd
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: start or stop qpidd
+# Description: Qpidd is an AMQP broker. It receives, stores, routes and forwards messages using the AMQP protcol.
+### END INIT INFO
+
+# chkconfig: - 85 15
+# description: Qpidd is an AMQP broker. It receives, stores, routes and forwards messages using the AMQP protcol.
+# processname: qpidd
+
+prog=qpidd
+lockfile=/var/lock/subsys/$prog
+pidfile=/var/run/qpidd.pid
+
+# The following variables can be overridden in @sysconfdir@/sysconfig/$prog
+QPID_INIT=@initdir@/$prog
+QPID_BIN=@sbindir@/$prog
+QPID_DATA_DIR=/var/lib/qpidd
+QPID_CONFIG=@confdir@/qpidd.conf
+QPID_HA=@bindir@/qpid-ha
+QPID_HA_OPTIONS="--config $QPID_CONFIG"
+
+# Source configuration
+test -f @sysconfdir@/sysconfig/$prog && source @sysconfdir@/sysconfig/$prog
+source /etc/rc.d/init.d/functions
+
+# Data dir: respect the config file if set.
+grep -q '^ *data-dir *=' $QPID_CONFIG || QPIDD_OPTIONS="$QPIDD_OPTIONS --data-dir=$QPID_DATA_DIR"
+
+# Check for HA configuration
+if grep -iq '^ *ha-cluster *= *\(true\|on\|1\|yes\)' $QPID_CONFIG; then
+ # HA is configured, do some extra checks.
+ test -x $QPID_HA || { echo "HA configured but $QPID_HA not found"; return 5; }
+
+ ha_ping() { $QPID_HA $QPID_HA_OPTIONS ping >/dev/null 2>&1; }
+
+ ha_allow_stop() {
+ # Primary script does not stop backup brokers and vice versa.
+ if $QPID_HA $QPID_HA_OPTIONS status --is-primary 2>&1 > /dev/null; then
+ [ "$1" = primary ] || { echo -n "stop primary broker with 'qpidd-primary stop'"; return 1; }
+ else
+ [ "$1" = primary ] && { echo -n "stop backup broker with 'qpidd stop'"; return 1; }
+ fi
+ return 0
+ }
+else
+ # No HA configuration, HA checks are no-ops.
+ ha_ping() { true; }
+ ha_allow_stop() { true; }
+fi
+
+# Check presence of executables/scripts
+for f in $QPID_BIN; do
+ test -x $f || { echo "$f not found or not executable"; exit 5; }
+done
+
+RETVAL=0
+
+# Ensure user has sufficient permissions
+runuser -s /bin/sh qpidd -c "echo x > /dev/null" 2> /dev/null || RETVAL=4
+if [ $RETVAL = 4 ]; then
+ echo "user had insufficient privilege";
+ exit $RETVAL
+fi
+
+do_status() {
+ # Check PID file and ping for liveness
+ MESSAGE=$(status -p $pidfile $prog) && {
+ ha_ping || return 1
+ }
+ RC=$?
+ echo $MESSAGE
+ return $RC
+}
+
+FLOCK_FD=9
+# Ensure no concurrent start/stop of services.
+lock() {
+ [ "$QPID_HA_LOCK_HELD" ] || { # Held by caller
+ exec 9< $QPID_INIT
+ flock $FLOCK_FD
+ }
+}
+
+start() {
+ lock
+ echo -n $"Starting Qpid AMQP daemon: "
+ touch $pidfile
+ chown qpidd.qpidd $pidfile
+ [ -x /sbin/restorecon ] && /sbin/restorecon $pidfile
+ daemon --pidfile $pidfile --check $prog --user qpidd $QPID_BIN --config $QPID_CONFIG --daemon $QPIDD_OPTIONS --close-fd $FLOCK_FD --pidfile $pidfile
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && touch $lockfile
+ return $RETVAL
+}
+
+stop() {
+ lock
+ if ha_allow_stop $1; then
+ echo -n $"Stopping Qpid AMQP daemon: "
+ killproc -p ${pidfile} $prog
+ RETVAL=$?
+ [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
+ fi
+ [ "$RETVAL" = 0 ] && success
+ echo
+ return $RETVAL
+}
+
+
+reload() {
+ echo 1>&2 $"$0: reload not supported"
+ return 3
+}
+
+restart() {
+ stop && start
+}
+
+# See how we were called.
+case "$1" in
+ start|stop|restart|reload)
+ $1 $2
+ ;;
+ status)
+ do_status
+ RETVAL=$?
+ ;;
+ force-reload)
+ restart
+ ;;
+ try-restart|condrestart)
+ [ -e $lockfile ] && restart || :
+ ;;
+ *)
+ echo 1>&2 $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|force-reload}"
+ exit 2
+esac
+
+exit $RETVAL
http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/88d08be3/etc/qpidd-primary.in
----------------------------------------------------------------------
diff --git a/etc/qpidd-primary.in b/etc/qpidd-primary.in
deleted file mode 100755
index 86bc76d..0000000
--- a/etc/qpidd-primary.in
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/usr/bin/env bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-# qpidd Startup script for the Qpid messaging daemon.
-#
-
-### BEGIN INIT INFO
-# Provides: qpidd-primary
-# Required-Start: $qpidd
-# Required-Stop: $qpidd
-# Default-Start:
-# Default-Stop: 0 1 2 3 4 5 6
-# Short-Description: promote qpidd to cluster primary
-# Description: Qpidd can be run in an active/passive cluster. Promote a running qpidd to primary.
-### END INIT INFO
-
-# chkconfig: - 85 15
-# description: Qpidd can be run in an active/passive cluster. Promote a running qpidd to primary.
-# processname: qpidd
-
-prog=qpidd
-
-# The following variables can be overridden in @sysconfdir@/sysconfig/$prog
-QPID_INIT=@initdir@/$prog
-QPID_CONFIG=@confdir@/qpidd.conf
-QPID_HA=@bindir@/qpid-ha
-QPID_HA_OPTIONS="--config $QPID_CONFIG"
-
-# Source configuration
-test -f @sysconfdir@/sysconfig/$prog && source @sysconfdir@/sysconfig/$prog
-source /etc/rc.d/init.d/functions
-
-# Check presence of executables/scripts
-for f in $QPID_INIT $QPID_HA; do
- test -x $f || { echo "$f not found or not executable"; exit 5; }
-done
-
-QPID_HA="$QPID_HA $QPID_HA_OPTIONS"
-
-RETVAL=0
-
-status() {
- if $QPID_HA status --is-primary ; then
- echo "qpidd is primary"
- else
- echo "qpidd is not primary"
- return 1
- fi
-}
-
-# Ensure no concurrent start/stop of services.
-lock() {
- export QPID_HA_LOCK_HELD=1 # For calls to the qpidd script
- exec 9< $QPID_INIT
- flock 9
-}
-
-start() {
- lock
- $QPID_INIT start primary || return $?
- echo -n $"Promoting to primary: "
- err=$($QPID_HA promote --cluster-manager 2>&1)
- RETVAL=$?
- [ $RETVAL = 0 ] && success || { echo -n "$err: "; failure; }
- echo
- return $RETVAL
-}
-
-stop() {
- $QPID_INIT stop primary
-}
-
-reload() {
- echo 1>&2 $"$0: reload not supported"
- return 3
-}
-
-restart() {
- stop && start
-}
-
-# See how we were called.
-case "$1" in
- start|stop|status|restart|reload)
- $1
- RETVAL=$?
- ;;
- force-reload)
- restart
- ;;
- *)
- echo 1>&2 $"Usage: $0 {start|stop|status|restart|force-reload}"
- exit 2
-esac
-
-exit $RETVAL
http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/88d08be3/etc/qpidd.in
----------------------------------------------------------------------
diff --git a/etc/qpidd.in b/etc/qpidd.in
deleted file mode 100755
index d363308..0000000
--- a/etc/qpidd.in
+++ /dev/null
@@ -1,168 +0,0 @@
-#!/usr/bin/env bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-# qpidd Startup script for the Qpid messaging daemon.
-#
-
-### BEGIN INIT INFO
-# Provides: qpidd
-# Required-Start: $local_fs
-# Required-Stop: $local_fs
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: start or stop qpidd
-# Description: Qpidd is an AMQP broker. It receives, stores, routes and forwards messages using the AMQP protcol.
-### END INIT INFO
-
-# chkconfig: - 85 15
-# description: Qpidd is an AMQP broker. It receives, stores, routes and forwards messages using the AMQP protcol.
-# processname: qpidd
-
-prog=qpidd
-lockfile=/var/lock/subsys/$prog
-pidfile=/var/run/qpidd.pid
-
-# The following variables can be overridden in @sysconfdir@/sysconfig/$prog
-QPID_INIT=@initdir@/$prog
-QPID_BIN=@sbindir@/$prog
-QPID_DATA_DIR=/var/lib/qpidd
-QPID_CONFIG=@confdir@/qpidd.conf
-QPID_HA=@bindir@/qpid-ha
-QPID_HA_OPTIONS="--config $QPID_CONFIG"
-
-# Source configuration
-test -f @sysconfdir@/sysconfig/$prog && source @sysconfdir@/sysconfig/$prog
-source /etc/rc.d/init.d/functions
-
-# Data dir: respect the config file if set.
-grep -q '^ *data-dir *=' $QPID_CONFIG || QPIDD_OPTIONS="$QPIDD_OPTIONS --data-dir=$QPID_DATA_DIR"
-
-# Check for HA configuration
-if grep -iq '^ *ha-cluster *= *\(true\|on\|1\|yes\)' $QPID_CONFIG; then
- # HA is configured, do some extra checks.
- test -x $QPID_HA || { echo "HA configured but $QPID_HA not found"; return 5; }
-
- ha_ping() { $QPID_HA $QPID_HA_OPTIONS ping >/dev/null 2>&1; }
-
- ha_allow_stop() {
- # Primary script does not stop backup brokers and vice versa.
- if $QPID_HA $QPID_HA_OPTIONS status --is-primary 2>&1 > /dev/null; then
- [ "$1" = primary ] || { echo -n "stop primary broker with 'qpidd-primary stop'"; return 1; }
- else
- [ "$1" = primary ] && { echo -n "stop backup broker with 'qpidd stop'"; return 1; }
- fi
- return 0
- }
-else
- # No HA configuration, HA checks are no-ops.
- ha_ping() { true; }
- ha_allow_stop() { true; }
-fi
-
-# Check presence of executables/scripts
-for f in $QPID_BIN; do
- test -x $f || { echo "$f not found or not executable"; exit 5; }
-done
-
-RETVAL=0
-
-# Ensure user has sufficient permissions
-runuser -s /bin/sh qpidd -c "echo x > /dev/null" 2> /dev/null || RETVAL=4
-if [ $RETVAL = 4 ]; then
- echo "user had insufficient privilege";
- exit $RETVAL
-fi
-
-do_status() {
- # Check PID file and ping for liveness
- MESSAGE=$(status -p $pidfile $prog) && {
- ha_ping || return 1
- }
- RC=$?
- echo $MESSAGE
- return $RC
-}
-
-FLOCK_FD=9
-# Ensure no concurrent start/stop of services.
-lock() {
- [ "$QPID_HA_LOCK_HELD" ] || { # Held by caller
- exec 9< $QPID_INIT
- flock $FLOCK_FD
- }
-}
-
-start() {
- lock
- echo -n $"Starting Qpid AMQP daemon: "
- touch $pidfile
- chown qpidd.qpidd $pidfile
- [ -x /sbin/restorecon ] && /sbin/restorecon $pidfile
- daemon --pidfile $pidfile --check $prog --user qpidd $QPID_BIN --config $QPID_CONFIG --daemon $QPIDD_OPTIONS --close-fd $FLOCK_FD --pidfile $pidfile
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && touch $lockfile
- return $RETVAL
-}
-
-stop() {
- lock
- if ha_allow_stop $1; then
- echo -n $"Stopping Qpid AMQP daemon: "
- killproc -p ${pidfile} $prog
- RETVAL=$?
- [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
- fi
- [ "$RETVAL" = 0 ] && success
- echo
- return $RETVAL
-}
-
-
-reload() {
- echo 1>&2 $"$0: reload not supported"
- return 3
-}
-
-restart() {
- stop && start
-}
-
-# See how we were called.
-case "$1" in
- start|stop|restart|reload)
- $1 $2
- ;;
- status)
- do_status
- RETVAL=$?
- ;;
- force-reload)
- restart
- ;;
- try-restart|condrestart)
- [ -e $lockfile ] && restart || :
- ;;
- *)
- echo 1>&2 $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|force-reload}"
- exit 2
-esac
-
-exit $RETVAL
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org