[rhmessaging-commits] rhmessaging commits: r985 - in store/trunk/cpp: etc and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue Oct 9 15:01:35 EDT 2007


Author: nunofsantos
Date: 2007-10-09 15:01:34 -0400 (Tue, 09 Oct 2007)
New Revision: 985

Modified:
   store/trunk/cpp/Makefile.am
   store/trunk/cpp/etc/rhmd
   store/trunk/cpp/rhm.spec.in
Log:
add rhmd.conf configuration file, instead of passing env vars to qpidd

Modified: store/trunk/cpp/Makefile.am
===================================================================
--- store/trunk/cpp/Makefile.am	2007-10-09 17:58:20 UTC (rev 984)
+++ store/trunk/cpp/Makefile.am	2007-10-09 19:01:34 UTC (rev 985)
@@ -1,8 +1,10 @@
 AUTOMAKE_OPTIONS = 1.9.6 foreign
 ACLOCAL_AMFLAGS = -I m4
 
-EXTRA_DIST = README etc/rhmd
+EXTRA_DIST = README etc/rhmd etc/rhmd.conf
 
+sysconf_DATA = etc/rhmd.conf
+
 SUBDIRS = lib tests docs
 
 # Update libtool, if needed.

Modified: store/trunk/cpp/etc/rhmd
===================================================================
--- store/trunk/cpp/etc/rhmd	2007-10-09 17:58:20 UTC (rev 984)
+++ store/trunk/cpp/etc/rhmd	2007-10-09 19:01:34 UTC (rev 985)
@@ -17,19 +17,63 @@
 # description: Qpidd is an AMQP broker. It receives, stores, routes and forwards messages using the AMQP protocol.
 # processname: qpidd
 
+prog=qpidd
 lockfile=/var/lock/subsys/rhmd
 
-LIBBDBSTORE=libbdbstore.so.0
+# Source function library.
+. /etc/rc.d/init.d/functions
 
-# See how we were called.                                                                           
+if [ -f /etc/sysconfig/$prog ] ; then
+	. /etc/sysconfig/$prog
+fi
+
+RETVAL=0
+
+start() {
+	echo -n $"Starting Qpid AMQP daemon: "
+	daemon --check $prog $prog --daemon --config=/etc/rhmd.conf
+	RETVAL=$?
+	echo
+	[ $RETVAL = 0 ] && touch $lockfile
+	return $RETVAL
+}
+
+stop() {
+	echo -n $"Stopping Qpid AMQP daemon: "
+	killproc $prog
+	RETVAL=$?
+	echo
+	[ $RETVAL = 0 ] && rm -f $lockfile
+}
+
+reload() {
+	echo 1>&2 $"$0: reload not supported"
+	exit 3
+}
+
+restart() {
+	stop
+	start
+}
+
+# See how we were called.
 case "$1" in
-  start|stop|restart|reload|status)
-        QPIDD_OPTIONS="-s $LIBBDBSTORE"
-        . /etc/rc.d/init.d/qpidd
-        exit $?
-        ;;
+  start|stop|restart|reload)
+	$1
+	;;
+  status)
+	status $prog
+	RETVAL=$?
+	;;
+  force-reload)
+	restart
+	;;
+  try-restart)
+	[ -e $lockfile ] && restart || :
+	;;
   *)
-        echo 1>&2 $"Usage: $0 {start|stop|restart|condrestart|status}"
-        exit 1
-	;;
+	echo 1>&2 $"Usage: $0 {start|stop|restart|condrestart|status}"
+	exit 1
 esac
+
+exit $RETVAL

Modified: store/trunk/cpp/rhm.spec.in
===================================================================
--- store/trunk/cpp/rhm.spec.in	2007-10-09 17:58:20 UTC (rev 984)
+++ store/trunk/cpp/rhm.spec.in	2007-10-09 19:01:34 UTC (rev 985)
@@ -38,6 +38,7 @@
 rm -rf %{buildroot}
 make install DESTDIR=%{buildroot}
 install -Dp -m0755 etc/rhmd %{buildroot}%{_initrddir}/rhmd
+#install -Dp -m0555 etc/rhmd.conf %{buildroot}%{_sysconfdir}/rhmd.conf
 rm -f %{buildroot}%_libdir/*.a
 rm -f %{buildroot}%_libdir/*.la
 rm -f %{buildroot}%_libdir/*.so
@@ -53,7 +54,8 @@
 %doc README COPYING
 %_libdir/libbdbstore.so.0
 %_libdir/libbdbstore.so.0.1.0
-%{_initrddir}/rhmd
+%_initrddir/rhmd
+%config(noreplace) %_sysconfdir/rhmd.conf
 
 %post
 # This adds the proper /etc/rc*.d links for the script




More information about the rhmessaging-commits mailing list