summaryrefslogtreecommitdiff
path: root/mailgraph-init
diff options
context:
space:
mode:
authorJulien Valroff <julien@kirya.net>2010-01-04 19:39:20 +0100
committerJulien Valroff <julien@kirya.net>2010-01-04 19:39:20 +0100
commitd906efbb1aacfebd9931d49028f6240a667bae14 (patch)
tree937aad588d7076854da1f31f779c8e7ab99557d8 /mailgraph-init
Imported Upstream version 1.14upstream/1.14
Diffstat (limited to 'mailgraph-init')
-rw-r--r--mailgraph-init42
1 files changed, 42 insertions, 0 deletions
diff --git a/mailgraph-init b/mailgraph-init
new file mode 100644
index 0000000..22b8357
--- /dev/null
+++ b/mailgraph-init
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# $Id: mailgraph-init 19 2005-06-13 11:23:22Z dws $
+# example init script for mailgraph
+#
+# chkconfig: 2345 82 28
+# description: mailgraph postfix log grapher.
+#
+# processname: mailgraph.pl
+# pidfile: /var/run/mailgraph.pid
+
+
+PATH=/bin:/usr/bin
+MAILGRAPH_PL=/usr/local/bin/mailgraph.pl
+MAIL_LOG=/var/log/syslog
+PID_FILE=/var/run/mailgraph.pid
+RRD_DIR=/var/lib
+
+case "$1" in
+'start')
+ echo "Starting mail statistics grapher: mailgraph";
+ nice -19 $MAILGRAPH_PL -l $MAIL_LOG -d \
+ --daemon-pid=$PID_FILE --daemon-rrd=$RRD_DIR
+ ;;
+
+'stop')
+ echo "Stopping mail statistics grapher: mailgraph";
+ if [ -f $PID_FILE ]; then
+ kill `cat $PID_FILE`
+ rm $PID_FILE
+ else
+ echo "mailgraph not running";
+ fi
+ ;;
+
+*)
+ echo "Usage: $0 { start | stop }"
+ exit 1
+ ;;
+
+esac
+exit 0