diff options
author | vs <vs@FreeBSD.org> | 2004-05-12 11:59:07 +0000 |
---|---|---|
committer | vs <vs@FreeBSD.org> | 2004-05-12 11:59:07 +0000 |
commit | fd60b1ca64153f5a856081a115b6f82cc5d09b0c (patch) | |
tree | 45d214895e6b73bca3ed4251bc2b6928674cb6de /mail/mailgraph/files | |
parent | b4311da3ccfbedcf501741a372786e5f30e6cece (diff) | |
download | FreeBSD-ports-fd60b1ca64153f5a856081a115b6f82cc5d09b0c.zip FreeBSD-ports-fd60b1ca64153f5a856081a115b6f82cc5d09b0c.tar.gz |
- Modify mail/mailgraph to use rc.subr
- Change rrd database from to /var/db/mailgraph.
PR: ports/66562
Submitted by: Rong-En Fan (maintainer)
Diffstat (limited to 'mail/mailgraph/files')
-rw-r--r-- | mail/mailgraph/files/mailgraph.sh | 17 | ||||
-rw-r--r-- | mail/mailgraph/files/mailgraph.sh.tmpl | 38 | ||||
-rw-r--r-- | mail/mailgraph/files/patch-mailgraph.cgi | 13 |
3 files changed, 51 insertions, 17 deletions
diff --git a/mail/mailgraph/files/mailgraph.sh b/mail/mailgraph/files/mailgraph.sh deleted file mode 100644 index bfa9bc3..0000000 --- a/mail/mailgraph/files/mailgraph.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -PREFIX=%%PREFIX%% - -case "$1" in -start) - /usr/bin/su www -c "cd ${PREFIX}/www/cgi-bin; ./mailgraph.pl -l /var/log/maillog" & > /dev/null 2>&1 && echo -n ' mailgraph' - ;; -stop) - ps -U www | grep mailgraph | awk '{print $1}' | xargs kill && echo -n ' mailgraph' - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - ;; -esac - -exit 0 diff --git a/mail/mailgraph/files/mailgraph.sh.tmpl b/mail/mailgraph/files/mailgraph.sh.tmpl new file mode 100644 index 0000000..1d54483 --- /dev/null +++ b/mail/mailgraph/files/mailgraph.sh.tmpl @@ -0,0 +1,38 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: mailgraph +# REQUIRE: DAEMON +# KEYWORD: FreeBSD +# +# Add the following line to /etc/rc.conf to enable mailgraph: +# +# mailgraph_enable="YES" +# + +. %%RC_SUBR%% + +name=mailgraph +rcvar=`set_rcvar` + +command=%%PREFIX%%/sbin/mailgraph.pl > /dev/null 2>&1 +command_interpreter=perl +stop_postcmd=stop_postcmd + +stop_postcmd() +{ + rm -f $pidfile +} + +mailgraph_enable=${mailgraph_enable:-"NO"} +mailgraph_pidfile=${mailgraph_pidfile:-"%%DATADIR%%/mailgraph.pid"} +mailgraph_flags=${mailgraph_flags:-"--logfile /var/log/maillog --daemon-rrd=%%DATADIR%% --ignore-localhost --daemon --daemon-pid=${mailgraph_pidfile}"} +mailgraph_user=${mailgraph_user:-"www"} +mailgraph_chdir=${mailgraph_chdir:-"%%DATADIR%%"} + +load_rc_config $name + +pidfile=${mailgraph_pidfile} + +run_rc_command "$1" diff --git a/mail/mailgraph/files/patch-mailgraph.cgi b/mail/mailgraph/files/patch-mailgraph.cgi new file mode 100644 index 0000000..15bd606 --- /dev/null +++ b/mail/mailgraph/files/patch-mailgraph.cgi @@ -0,0 +1,13 @@ +--- mailgraph.cgi.orig Sat Feb 7 21:48:52 2004 ++++ mailgraph.cgi Mon Apr 12 02:45:53 2004 +@@ -15,8 +15,8 @@ + my $points_per_sample = 3; + my $ypoints = 150; + my $ypoints_err = 80; +-my $rrd = 'mailgraph.rrd'; # path to where the RRD database is +-my $rrd_virus = 'mailgraph_virus.rrd'; # path to where the Virus RRD database is ++my $rrd = '%%DATADIR%%/mailgraph.rrd'; # path to where the RRD database is ++my $rrd_virus = '%%DATADIR%%/mailgraph_virus.rrd'; # path to where the Virus RRD database is + my $tmp_dir = '/tmp/mailgraph'; # temporary directory where to store the images + + my @graphs = ( |