summaryrefslogtreecommitdiff
path: root/cpp/etc
diff options
context:
space:
mode:
authorJim Meyering <meyering@apache.org>2007-07-09 14:26:42 +0000
committerJim Meyering <meyering@apache.org>2007-07-09 14:26:42 +0000
commitfcb5a8016df0b2d85a43cf20c07cb00b305fb8f6 (patch)
tree175516e4bf7ec48473a1003458c8959a7c45ccc8 /cpp/etc
parentc4bf499790c30e0c98dd560c50c64c8a27fd9b89 (diff)
downloadqpid-python-fcb5a8016df0b2d85a43cf20c07cb00b305fb8f6.tar.gz
Update for Fedora init-scripts guidelines:
<http://fedoraproject.org/wiki/FCNewInit/Initscripts> * etc/qpidd: Provide an LSB header. Allow options to be specified via QPIDD_OPTIONS=... in /etc/sysconfig/qpidd. Diagnose and 'exit 3' for the unsupported "reload". Don't mention unused $pidfile. Remove useless curly braces: ${lockfile} -> $lockfile. Write usage and error diagnostics to stderr, not stdout. Change spelling: condrestart -> try-restart. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@554659 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/etc')
-rwxr-xr-xcpp/etc/qpidd57
1 files changed, 36 insertions, 21 deletions
diff --git a/cpp/etc/qpidd b/cpp/etc/qpidd
index cfd6049c9b..ed9a3ececb 100755
--- a/cpp/etc/qpidd
+++ b/cpp/etc/qpidd
@@ -2,10 +2,21 @@
#
# 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
@@ -13,15 +24,20 @@ lockfile=/var/lock/subsys/$prog
# Source function library.
. /etc/rc.d/init.d/functions
+QPIDD_OPTIONS=
+if [ -f /etc/sysconfig/$prog ] ; then
+ . /etc/sysconfig/$prog
+fi
+
RETVAL=0
start() {
- echo -n $"Starting Qpid AMQP daemon: "
- daemon $prog --daemon
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && touch ${lockfile}
- return $RETVAL
+ echo -n $"Starting Qpid AMQP daemon: "
+ daemon --check $prog $prog --daemon $QPIDD_OPTIONS
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && touch $lockfile
+ return $RETVAL
}
stop() {
@@ -29,7 +45,12 @@ stop() {
killproc $prog
RETVAL=$?
echo
- [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
+ [ $RETVAL = 0 ] && rm -f $lockfile
+}
+
+reload() {
+ echo 1>&2 $"$0: reload not supported"
+ exit 3
}
restart() {
@@ -39,27 +60,21 @@ restart() {
# See how we were called.
case "$1" in
- start)
- start
- ;;
- stop)
- stop
+ start|stop|restart|reload)
+ $1
;;
status)
- status $prog
+ status $prog
RETVAL=$?
;;
- restart|reload)
+ force-reload)
restart
;;
- condrestart)
- if [ -e $lockfile ] ; then restart ; fi
- ;;
- reload)
- reload
+ try-restart)
+ [ -e $lockfile ] && restart || :
;;
*)
- echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}"
+ echo 1>&2 $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac