qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meyer...@apache.org
Subject svn commit: r554659 - /incubator/qpid/trunk/qpid/cpp/etc/qpidd
Date Mon, 09 Jul 2007 14:26:42 GMT
Author: meyering
Date: Mon Jul  9 07:26:42 2007
New Revision: 554659

URL: http://svn.apache.org/viewvc?view=rev&rev=554659
Log:
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.

Modified:
    incubator/qpid/trunk/qpid/cpp/etc/qpidd

Modified: incubator/qpid/trunk/qpid/cpp/etc/qpidd
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/etc/qpidd?view=diff&rev=554659&r1=554658&r2=554659
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/etc/qpidd (original)
+++ incubator/qpid/trunk/qpid/cpp/etc/qpidd Mon Jul  9 07:26:42 2007
@@ -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 @@
 # 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 @@
 	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 @@
 
 # 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
 



Mime
View raw message