Actually if we made
PROCESS=`echo $SERVICE | tr '-' '_'`
then we could just reuse this init script for all our agents.
So matahari.init is probably the right name afterall for the thing
that gets checked in, and we'll just have the spec file install copies
with the 'right' name.
Sorry about that.
On Thu, Sep 16, 2010 at 4:38 PM, Adam Stokes <astokes(a)fedoraproject.org> wrote:
---
CMakeLists.txt | 10 +++++++
matahari.init | 75 ----------------------------------------------------
matahari_host.init | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 85 insertions(+), 75 deletions(-)
delete mode 100644 matahari.init
create mode 100644 matahari_host.init
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2a30360..098efc4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,19 @@
cmake_minimum_required(VERSION 2.6)
project (MATAHARI)
+set (PROJECT_VERSION "0.0.5")
+
+# install docs
+install(FILES COPYING AUTHORS DESTINATION doc/matahari-${PROJECT_VERSION})
# add sub-directories
add_subdirectory(src)
+# install schema files
+file(GLOB SCHEMA "src/*.xml")
+install(FILES ${SCHEMA} DESTINATION share/matahari)
+
+
+
# check includes
include (CheckIncludeFiles)
check_include_files (string.h HAVE_STRING_H)
diff --git a/matahari.init b/matahari.init
deleted file mode 100644
index bee1145..0000000
--- a/matahari.init
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-
-# the following is chkconfig init header
-# matahari-host: host qmf agent
-# chkconfig: - 99 01
-# description: This is a daemon acts as a host qmf agent
-# processname: matahari-host
-# pidfile: /var/run/matahari.pid
-#
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-SERVICE=matahari-host
-PROCESS=matahari-host
-
-RETVAL=0
-
-[ -f /etc/sysconfig/$SERVICE ] && . /etc/sysconfig/$SERVICE
-
-start() {
- echo -n $"Starting $SERVICE daemon: "
- daemon $PROCESS $MATAHARI_ARGS
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SERVICE
-}
-
-stop() {
- echo -n $"Stopping $SERVICE daemon: "
-
- killproc $PROCESS
- RETVAL=$?
- echo
- if [ $RETVAL -eq 0 ]; then
- rm -f /var/lock/subsys/$SERVICE
- rm -f /var/run/$SERVICE.pid
- fi
-}
-
-restart() {
- stop
- start
-}
-
-reload() {
- echo -n $"Reloading $SERVICE configuration: "
-
- killproc $PROCESS -HUP
- RETVAL=$?
- echo
- return $RETVAL
-}
-
-# See how we were called.
-case "$1" in
- start|stop|restart|reload)
- $1
- ;;
- status)
- status $PROCESS
- RETVAL=$?
- ;;
- force-reload)
- reload
- ;;
- condrestart|try-restart)
- [ -f /var/lock/subsys/$SERVICE ] && restart || :
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
- exit 1
- ;;
-esac
-exit $RETVAL
diff --git a/matahari_host.init b/matahari_host.init
new file mode 100644
index 0000000..169e6d0
--- /dev/null
+++ b/matahari_host.init
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+# the following is chkconfig init header
+# matahari-host: host qmf agent
+# chkconfig: - 99 01
+# description: This is a daemon acts as a host qmf agent
+# processname: matahari-host
+# pidfile: /var/run/matahari.pid
+#
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+SERVICE=`basename "$0"`
+PROCESS=matahari-host
+
+RETVAL=0
+
+[ -f /etc/sysconfig/$SERVICE ] && . /etc/sysconfig/$SERVICE
+
+start() {
+ echo -n $"Starting $SERVICE daemon: "
+ daemon $PROCESS $MATAHARI_ARGS
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SERVICE
+}
+
+stop() {
+ echo -n $"Stopping $SERVICE daemon: "
+
+ killproc $PROCESS
+ RETVAL=$?
+ echo
+ if [ $RETVAL -eq 0 ]; then
+ rm -f /var/lock/subsys/$SERVICE
+ rm -f /var/run/$SERVICE.pid
+ fi
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ echo -n $"Reloading $SERVICE configuration: "
+
+ killproc $PROCESS -HUP
+ RETVAL=$?
+ echo
+ return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+ start|stop|restart|reload)
+ $1
+ ;;
+ status)
+ status $PROCESS
+ RETVAL=$?
+ ;;
+ force-reload)
+ reload
+ ;;
+ condrestart|try-restart)
+ [ -f /var/lock/subsys/$SERVICE ] && restart || :
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
+ exit 1
+ ;;
+esac
+exit $RETVAL
--
1.7.2.3
_______________________________________________
Matahari mailing list
Matahari(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/matahari