summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrej Kacian <ticho@gentoo.org>2007-04-01 19:30:00 +0000
committerAndrej Kacian <ticho@gentoo.org>2007-04-01 19:30:00 +0000
commitfef3fdefa72304c01c27fe2d10c7792a46ed42ec (patch)
tree75ac5853215b68a7ec0e31da7c44fa324a583c4e /net-mail/mailgraph/files
parentFix Manifest (diff)
downloadgentoo-2-fef3fdefa72304c01c27fe2d10c7792a46ed42ec.tar.gz
gentoo-2-fef3fdefa72304c01c27fe2d10c7792a46ed42ec.tar.bz2
gentoo-2-fef3fdefa72304c01c27fe2d10c7792a46ed42ec.zip
Use ebuild by Wolfram Schlich <wschlich at gentoo.org>, bug #149175 for 1.13. This makes mailgraph not run as root.
(Portage version: 2.1.2.3)
Diffstat (limited to 'net-mail/mailgraph/files')
-rw-r--r--net-mail/mailgraph/files/mailgraph.confd-new19
-rw-r--r--net-mail/mailgraph/files/mailgraph.initd-new28
-rw-r--r--net-mail/mailgraph/files/mailgraph.logrotate-new31
3 files changed, 78 insertions, 0 deletions
diff --git a/net-mail/mailgraph/files/mailgraph.confd-new b/net-mail/mailgraph/files/mailgraph.confd-new
new file mode 100644
index 000000000000..8ac31ca3c3d0
--- /dev/null
+++ b/net-mail/mailgraph/files/mailgraph.confd-new
@@ -0,0 +1,19 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-mail/mailgraph/files/mailgraph.confd-new,v 1.1 2007/04/01 19:30:00 ticho Exp $
+
+# Location of logfile that all (!) mail software (MTA, spamfilter etc.) logs to.
+# mailgraph defaults to /var/log/syslog if unspecified
+MG_LOGFILE="/var/log/messages"
+
+# Required daemon settings
+MG_DAEMON_UID="mgraph"
+MG_DAEMON_GID="adm"
+MG_DAEMON_UMASK="0022"
+MG_DAEMON_LOG="/var/log/mailgraph/mailgraph.log"
+MG_DAEMON_PID="/var/run/mailgraph/mailgraph.pid"
+MG_DAEMON_RRD="/var/lib/mailgraph"
+
+# Specify any extra options here.
+# If MG_LOGFILE is in metalog format, add "-t metalog" to MG_DAEMON_OPTS
+MG_DAEMON_OPTS="--ignore-localhost"
diff --git a/net-mail/mailgraph/files/mailgraph.initd-new b/net-mail/mailgraph/files/mailgraph.initd-new
new file mode 100644
index 000000000000..57b20cb1c80f
--- /dev/null
+++ b/net-mail/mailgraph/files/mailgraph.initd-new
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-mail/mailgraph/files/mailgraph.initd-new,v 1.1 2007/04/01 19:30:00 ticho Exp $
+
+start() {
+ ebegin "Starting mailgraph"
+
+ # read mail log messages somewhere other than /var/log/syslog?
+ [[ -n "${MG_LOGFILE}" ]] && MG_DAEMON_OPTS="${MG_DAEMON_OPTS} -l ${MG_LOGFILE}"
+
+ UMASK=$(umask)
+ umask ${MG_DAEMON_UMASK:-0077}
+ start-stop-daemon --start \
+ -c "${MG_DAEMON_UID}:${MG_DAEMON_GID}" \
+ --exec /usr/bin/mailgraph -- -v --daemon \
+ --daemon-log="${MG_DAEMON_LOG}" \
+ --daemon-pid="${MG_DAEMON_PID}" \
+ --daemon-rrd=/var/lib/mailgraph ${MG_DAEMON_OPTS}
+ eend $?
+ umask "${UMASK}"
+}
+
+stop() {
+ ebegin "Shutting down mailgraph"
+ start-stop-daemon --stop --quiet --pidfile "${MG_DAEMON_PID}"
+ eend $?
+}
diff --git a/net-mail/mailgraph/files/mailgraph.logrotate-new b/net-mail/mailgraph/files/mailgraph.logrotate-new
new file mode 100644
index 000000000000..0049b8b0307d
--- /dev/null
+++ b/net-mail/mailgraph/files/mailgraph.logrotate-new
@@ -0,0 +1,31 @@
+# $Header: /var/cvsroot/gentoo-x86/net-mail/mailgraph/files/mailgraph.logrotate-new,v 1.1 2007/04/01 19:30:00 ticho Exp $
+# logrotate config for mailgraph log
+
+/var/log/mailgraph/mailgraph.log {
+ ## rotate daily
+ daily
+ ## keep 30 old copies
+ rotate 30
+ ## use .YYYYMMDD instead of .0,.1,.2 etc.
+ dateext
+ ## also rotate empty logfiles to strictly retain chronology
+ ifempty
+ ## re-create source logfile with original permissions
+ ## do NOT use copy or copytruncate!
+ create
+ ## compress on next logrotate run (e.g. next day) to give
+ ## programs the chance to close the old logfile
+ delaycompress
+ ## compress logfiles
+ compress
+ compresscmd /bin/gzip
+ compressoptions -9
+ uncompresscmd /bin/gunzip
+ ## don't throw an error when a file doesn't exist
+ missingok
+ ## restart mailgraph after rotating all logfiles
+ sharedscripts
+ postrotate
+ /etc/init.d/mailgraph restart >/dev/null
+ endscript
+}