Changed the `-d' switch to `-D' in the init.d-files
authorocto <octo>
Fri, 16 Dec 2005 12:55:32 +0000 (12:55 +0000)
committerocto <octo>
Fri, 16 Dec 2005 12:55:32 +0000 (12:55 +0000)
Added revision to ChangeLog
Commented out the creation of `$prefix/etc' in Makefile.am

ChangeLog
Makefile.am
contrib/init.d-rh7 [new file with mode: 0755]
debian/collectd.init.d [new file with mode: 0755]

index a5dba07..2194ed8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-2005-12-07, Version 3.5.0
+2005-12-07, Version 3.5.0 (Revision 321)
        * A bug in the `load' module under Solaris has been fixed.
        * The `users' module has been contributed by Sebastian Harl. It counts
          currently logged in users.
index 30beb63..8aaf4f7 100644 (file)
@@ -7,6 +7,6 @@ dist-hook:
        find $(distdir) -type d -name '.svn' | xargs rm -rf
 
 install-exec-hook:
-       $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
        $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run
        $(mkinstalldirs) $(DESTDIR)$(localstatedir)/lib/$(PACKAGE_NAME)
+       #$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
diff --git a/contrib/init.d-rh7 b/contrib/init.d-rh7
new file mode 100755 (executable)
index 0000000..ec20d68
--- /dev/null
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+# Source function library.
+. /etc/init.d/functions
+
+RETVAL=0
+ARGS=""
+prog="collectd"
+
+if [ -r /etc/default/$prog ]; then
+       . /etc/default/$prog
+fi
+
+if [ -n "$DATA_DIR" ]; then
+       ARGS="-D $DATA_DIR"
+fi
+
+if [ -n "$PING_HOST" ]; then
+       for HOST in $PING_HOST
+       do
+               ARGS="$ARGS -p $HOST"
+       done
+fi
+
+start () {
+       if [ "x$START_SERVER" = "xyes" ]
+       then
+               echo -n $"Starting $prog (server): "
+               daemon /usr/sbin/collectd -s $ARGS
+               RETVAL=$?
+               echo
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
+       fi
+       if [ "x$START_CLIENT" = "xyes" ]
+       then
+               echo -n $"Starting $prog (client): "
+               daemon /usr/sbin/collectd -c $ARGS
+               RETVAL=$?
+               echo
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
+       fi
+       if [ "x$START_SERVER" != "xyes" -a "x$START_CLIENT" != "xyes" ]
+       then
+               echo -n $"Starting $prog: "
+               daemon /usr/sbin/collectd -l $ARGS
+               RETVAL=$?
+               echo
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
+       fi
+}
+stop () {
+       echo -n $"Stopping $prog: "
+       killproc $prog
+       RETVAL=$?
+       echo
+       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
+}
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  status)
+       status $prog
+       ;;
+  restart|reload)
+       stop
+       start
+       ;;
+  condrestart)
+       [ -f /var/lock/subsys/$prog ] && restart || :
+       ;;
+  *)
+       echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
+       exit 1
+esac
+
+exit $?
+
+# vim:syntax=sh
diff --git a/debian/collectd.init.d b/debian/collectd.init.d
new file mode 100755 (executable)
index 0000000..2006471
--- /dev/null
@@ -0,0 +1,87 @@
+#!/bin/sh
+#
+# collectd     Initscript for collectd
+#              http://verplant.org/collectd/
+# Author:      Florian Forster <octo@verplant.org>
+#
+
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DESC="Statistics collection daemon"
+NAME=collectd
+DAEMON=/usr/sbin/$NAME
+SCRIPTNAME=/etc/init.d/$NAME
+ARGS=""
+
+# Gracefully exit if the package has been removed.
+test -x $DAEMON || exit 0
+
+if [ -r /etc/default/$NAME ]
+then
+       . /etc/default/$NAME
+fi
+
+if [ -n "$DATA_DIR" ]; then
+       ARGS="-D $DATA_DIR"
+fi
+
+if [ -n "$PING_HOST" ]; then
+       for HOST in $PING_HOST
+       do
+               ARGS="$ARGS -p $HOST"
+       done
+fi
+
+#
+#      Function that starts the daemon/service.
+#
+d_start() {
+       if [ "x$START_SERVER" = "xyes" ]
+       then
+               $DAEMON -s $ARGS
+       fi
+       if [ "x$START_CLIENT" = "xyes" ]
+       then
+               $DAEMON -c $ARGS
+       fi
+       if [ "x$START_SERVER" != "xyes" -a "x$START_CLIENT" != "xyes" ]
+       then
+               start-stop-daemon --start --quiet --exec $DAEMON -- -l $ARGS
+       fi
+}
+
+#
+#      Function that stops the daemon/service.
+#
+d_stop() {
+       start-stop-daemon --stop --quiet --exec $DAEMON
+}
+
+case "$1" in
+  start)
+       echo -n "Starting $DESC: $NAME"
+       d_start
+       echo "."
+       ;;
+  stop)
+       echo -n "Stopping $DESC: $NAME"
+       d_stop
+       echo "."
+       ;;
+  restart|force-reload)
+       echo -n "Restarting $DESC: $NAME"
+       d_stop
+       sleep 1
+       d_start
+       echo "."
+       ;;
+  *)
+       echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+       exit 1
+       ;;
+esac
+
+exit 0
+
+# vim:syntax=sh