diff options
author | Jon Hood <squinky86@gentoo.org> | 2004-07-03 03:29:25 +0000 |
---|---|---|
committer | Jon Hood <squinky86@gentoo.org> | 2004-07-03 03:29:25 +0000 |
commit | 97bf5c35e20795b58a5a4102d826ce73d3337484 (patch) | |
tree | ac0c57ca25de4cce08b6dd26b8dd766f4ad47f2a /net-analyzer/mrtg | |
parent | like, totally a version bump. fershure! test it out. it's totally RAD (Manife... (diff) | |
download | gentoo-2-97bf5c35e20795b58a5a4102d826ce73d3337484.tar.gz gentoo-2-97bf5c35e20795b58a5a4102d826ce73d3337484.tar.bz2 gentoo-2-97bf5c35e20795b58a5a4102d826ce73d3337484.zip |
add init script, closing #13839
Diffstat (limited to 'net-analyzer/mrtg')
-rw-r--r-- | net-analyzer/mrtg/ChangeLog | 6 | ||||
-rw-r--r-- | net-analyzer/mrtg/files/mrtg.rc | 47 | ||||
-rw-r--r-- | net-analyzer/mrtg/mrtg-2.10.14.ebuild | 3 |
3 files changed, 54 insertions, 2 deletions
diff --git a/net-analyzer/mrtg/ChangeLog b/net-analyzer/mrtg/ChangeLog index 2831dfc1d526..8c166b781884 100644 --- a/net-analyzer/mrtg/ChangeLog +++ b/net-analyzer/mrtg/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-analyzer/mrtg # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/ChangeLog,v 1.21 2004/06/24 22:07:41 agriffis Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/ChangeLog,v 1.22 2004/07/03 03:29:25 squinky86 Exp $ + + 02 Jul 2004; Jon Hood <squinky86@gentoo.org> +files/mrtg.rc, + mrtg-2.10.14.ebuild: + add init script from Matthew Smith <matthewsmith@iinet.net.au> closing #13839 *mrtg-2.10.14 (08 Jun 2004) diff --git a/net-analyzer/mrtg/files/mrtg.rc b/net-analyzer/mrtg/files/mrtg.rc new file mode 100644 index 000000000000..c04ef8741d9f --- /dev/null +++ b/net-analyzer/mrtg/files/mrtg.rc @@ -0,0 +1,47 @@ +#!/sbin/runscript +# Copyright 1999-2003 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/files/mrtg.rc,v 1.1 2004/07/03 03:29:25 squinky86 Exp $ + +# This runscript is for those who want to use the RunAsDaemon:Yes +# option for MRTG instead of launching it from a cron job. + + +# Set the following variables for your setup + +MRTGPREFIX=/usr/bin +MRTGCONF=/etc/mrtg.conf +# pid file defaults to same dir as config file (edit $MRTGPREFIX/mrtg) +# if you don't like it. +MRTGPID=/etc/mrtg.pid + + +depend() { + need net + + # if monitoring snmp variables on this machine: + # use net-snmpd +} + +checkconfig() { + if [ ! -f $MRTGCONF ] ; then + eerror "Please create $MRTGCONF (try man cfgmaker)" + eerror "Make sure you use RunAsDaemon:Yes" + return 1 + fi + return 0 +} + +start() { + checkconfig || return $? + ebegin "Starting mrtg" + start-stop-daemon --start --quiet --pidfile $MRTGPID \ + --startas $MRTGPREFIX/mrtg $MRTGCONF + eend $? "Failed to start mrtg" +} + +stop() { + ebegin "Stopping mrtg" + start-stop-daemon --stop --quiet --pidfile $MRTGPID + eend $? "Failed to stop mrtg" +} diff --git a/net-analyzer/mrtg/mrtg-2.10.14.ebuild b/net-analyzer/mrtg/mrtg-2.10.14.ebuild index 2de808203562..49f89783e2c6 100644 --- a/net-analyzer/mrtg/mrtg-2.10.14.ebuild +++ b/net-analyzer/mrtg/mrtg-2.10.14.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/mrtg-2.10.14.ebuild,v 1.4 2004/06/30 17:35:28 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/mrtg/mrtg-2.10.14.ebuild,v 1.5 2004/07/03 03:29:25 squinky86 Exp $ DESCRIPTION="A tool to monitor the traffic load on network-links" HOMEPAGE="http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/" @@ -30,4 +30,5 @@ src_install () { cp -a contrib ${D}/usr/share/doc/${PF}/contrib prepalldocs docinto html ; dohtml -r doc/*.html images/* + exeinto /etc/init.d ; newexe ${FILESDIR}/mrtg.rc mrtg } |