summaryrefslogtreecommitdiff
path: root/debian/init
diff options
context:
space:
mode:
authorChristian Perrier <bubulle@debian.org>2008-07-16 22:41:04 +0200
committerJulien Valroff <julien@kirya.net>2010-01-04 19:39:21 +0100
commit01b76eb9b6121b19a376a9c447c5d431c7392c1c (patch)
treec2858ea28031a3bcee1036299f91f7f613ee391b /debian/init
parentd906efbb1aacfebd9931d49028f6240a667bae14 (diff)
Imported Debian patch 1.14-1.2debian/1.14-1.2
Diffstat (limited to 'debian/init')
-rw-r--r--debian/init60
1 files changed, 60 insertions, 0 deletions
diff --git a/debian/init b/debian/init
new file mode 100644
index 0000000..cd5bdff
--- /dev/null
+++ b/debian/init
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides: mailgraph
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Mail statistics frontend for Postfix
+### END INIT INFO
+
+MAILGRAPH_CONFIG="/etc/default/mailgraph"
+NAME="mailgraph"
+DAEMON="/usr/sbin/mailgraph"
+PID_FILE="/var/run/mailgraph.pid"
+RRD_DIR="/var/lib/mailgraph"
+IGNORE_OPTION=""
+
+if [ -f $MAILGRAPH_CONFIG ]; then
+ . $MAILGRAPH_CONFIG
+else
+ exit 0
+fi
+
+test -x $DAEMON || exit 0
+
+if [ "$BOOT_START" = "false" ] ; then
+ exit 0
+fi
+
+if [ "$IGNORE_LOCALHOST" = "true" ]; then
+ IGNORE_OPTION="--ignore-localhost"
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting Postfix Mail Statistics: $NAME"
+ start-stop-daemon -S -q -b -p $PID_FILE -x $DAEMON -- -l $MAIL_LOG -d --daemon_rrd=$RRD_DIR $IGNORE_OPTION
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping Postfix Mail Statistics: $NAME"
+ if [ -f $PID_FILE ]; then
+ kill `cat $PID_FILE`
+ rm $PID_FILE
+ fi
+ echo "."
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ force-reload)
+ $0 restart
+ ;;
+ *)
+ echo "Usage: $0 start|stop|restart|force-reload"
+ exit 1
+ ;;
+esac