diff options
author | Ray Russell Reese III <anti@gentoo.org> | 2004-05-30 00:05:17 +0000 |
---|---|---|
committer | Ray Russell Reese III <anti@gentoo.org> | 2004-05-30 00:05:17 +0000 |
commit | d992d60022c6cdd472c262034bbe4daa22a2c592 (patch) | |
tree | 51f870685367926e51555b70a27e5351b3b1e6b4 /net-analyzer/rtg/files | |
parent | fix bug #52387. cleanup some use stuff. (diff) | |
download | gentoo-2-d992d60022c6cdd472c262034bbe4daa22a2c592.tar.gz gentoo-2-d992d60022c6cdd472c262034bbe4daa22a2c592.tar.bz2 gentoo-2-d992d60022c6cdd472c262034bbe4daa22a2c592.zip |
Added new init.d script
Diffstat (limited to 'net-analyzer/rtg/files')
-rw-r--r-- | net-analyzer/rtg/files/digest-rtg-0.7.4-r1 | 1 | ||||
-rw-r--r-- | net-analyzer/rtg/files/rtgpoll.confd | 9 | ||||
-rw-r--r-- | net-analyzer/rtg/files/rtgpoll.initd | 49 |
3 files changed, 59 insertions, 0 deletions
diff --git a/net-analyzer/rtg/files/digest-rtg-0.7.4-r1 b/net-analyzer/rtg/files/digest-rtg-0.7.4-r1 new file mode 100644 index 000000000000..fd1fc2b8a83e --- /dev/null +++ b/net-analyzer/rtg/files/digest-rtg-0.7.4-r1 @@ -0,0 +1 @@ +MD5 c61ff1323701e2771bb5ff9cf67f1b77 rtg-0.7.4.tar.gz 710621 diff --git a/net-analyzer/rtg/files/rtgpoll.confd b/net-analyzer/rtg/files/rtgpoll.confd new file mode 100644 index 000000000000..0ef172060796 --- /dev/null +++ b/net-analyzer/rtg/files/rtgpoll.confd @@ -0,0 +1,9 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/rtg/files/rtgpoll.confd,v 1.1 2004/05/30 00:05:17 anti Exp $ + +# RTGPOLL_TARGETS defines the targets file to run the poller on. The default +# should be fine. + +RTGPOLL_TARGETS=/etc/rtg/targets.cfg + diff --git a/net-analyzer/rtg/files/rtgpoll.initd b/net-analyzer/rtg/files/rtgpoll.initd new file mode 100644 index 000000000000..8f76af1653f6 --- /dev/null +++ b/net-analyzer/rtg/files/rtgpoll.initd @@ -0,0 +1,49 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/rtg/files/rtgpoll.initd,v 1.1 2004/05/30 00:05:17 anti Exp $ + +[ -z "${RTGPOLL_TARGETS}" ] && RTGPOLL_TARGETS=/etc/rtg/targets.cfg + +opts="${opts} reload" + +depend() { + need net mysql +} + +checkconfig() { + if [ ! -e /etc/rtg/rtg.conf ] ; then + eerror "You need an /etc/rtg/rtg.conf config file to run rtgpoll" + return 1 + fi + + if [ ! -e "${RTGPOLL_TARGETS}" ] ; then + eerror "${RTGPOLL_TARGETS} doesn't exist, you must have a targets configuration to run rtgpoll" + return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting rtgpoll" + start-stop-daemon --start --background --quiet --pidfile /var/run/rtgpoll.pid --exec /usr/bin/rtgpoll -- -t ${RTGPOLL_TARGETS} + eend $? +} + +reload() { + if [ ! -f /var/run/rtgpoll.pid ]; then + eerror "rtgpoll isn't running" + return 1 + fi + ebegin "Reloading configuration" + kill -HUP `cat /var/run/rtgpoll.pid` &>/dev/null + eend $? +} + + +stop() { + ebegin "Stopping rtgpoll" + start-stop-daemon --stop --quiet --signal 9 --name rtgpoll --pidfile /var/run/rtgpoll.pid + eend $? +} + |