]> git.pld-linux.org Git - packages/mailgraph.git/blame - mailgraph.init
- update mailgraph-paths.patch to change paths in mailgraph.pl
[packages/mailgraph.git] / mailgraph.init
CommitLineData
ab939c55
GS
1#!/bin/sh
2#
3# mailgraph This shell script takes care of starting and stopping
4# mailgraph service.
5#
6# chkconfig: 345 55 45
7# description: mailgraph watch postfix logfiles and generate www statistics
8
9# Source function library.
10. /etc/rc.d/init.d/functions
11
12# See how we were called.
13case "$1" in
14 start)
15 # Check if the service is already running?
16 if [ ! -f /var/lock/subsys/mailgraph ]; then
17 msg_starting "mailgraph"
18 busy
327de406 19 /usr/bin/mailgraph.pl >/dev/null 2>&1 &
ab939c55
GS
20 sleep 1
21 ps -C mailgraph >/dev/null 2>&1
22 RETVAL=$?
23 CPID=$!
24 if [ $RETVAL -eq 0 ]; then
25 touch /var/lock/subsys/mailgraph
26 echo $CPID >/var/run/mailgraph.pid
27 deltext; ok;
28 else
29 deltext; fail;
30 fi
31 else
9372e070 32 msg_already_running "mailgraph"
ab939c55
GS
33 exit 1
34 fi
35
36 ;;
37 stop)
38 if [ -f /var/lock/subsys/mailgraph ]; then
39 msg_stopping "mailgraph"
40 #busy
41 killproc mailgraph
42 #deltext; ok;
43 rm -f /var/lock/subsys/mailgraph >/dev/null 2>&1
44 rm -f /var/run/mailgraph.pid >/dev/null 2>&1
45 else
9372e070 46 msg_not_running "mailgraph"
ab939c55
GS
47 exit 1
48 fi
49
50 ;;
51 status)
52 status mailgraph
53 exit $?
54 ;;
55 restart)
56 $0 stop
57 $0 start
58 ;;
59 *)
9372e070 60 msg_usage "$0 {start|stop|status|restart}"
ab939c55
GS
61 exit 1
62esac
63
64exit $RETVAL
This page took 0.129467 seconds and 4 git commands to generate.