diff options
author | Tobias Klausmann <klausman@gentoo.org> | 2012-08-29 13:34:31 +0000 |
---|---|---|
committer | Tobias Klausmann <klausman@gentoo.org> | 2012-08-29 13:34:31 +0000 |
commit | ab308ecb2f682d587ec0608d3ac36c7107f0d6fa (patch) | |
tree | 733955f6b3bf278e5220abdec3bf952e12648ebc /net-analyzer/smokeping | |
parent | Remove old. (diff) | |
download | gentoo-2-ab308ecb2f682d587ec0608d3ac36c7107f0d6fa.tar.gz gentoo-2-ab308ecb2f682d587ec0608d3ac36c7107f0d6fa.tar.bz2 gentoo-2-ab308ecb2f682d587ec0608d3ac36c7107f0d6fa.zip |
Add missing init script. Also, CVS is dumb and should be hated.
(Portage version: 2.1.11.12/cvs/Linux x86_64)
Diffstat (limited to 'net-analyzer/smokeping')
-rw-r--r-- | net-analyzer/smokeping/ChangeLog | 6 | ||||
-rwxr-xr-x | net-analyzer/smokeping/files/smokeping.init.3 | 77 |
2 files changed, 81 insertions, 2 deletions
diff --git a/net-analyzer/smokeping/ChangeLog b/net-analyzer/smokeping/ChangeLog index 2e68de59f26d..25dc8ae603e5 100644 --- a/net-analyzer/smokeping/ChangeLog +++ b/net-analyzer/smokeping/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for net-analyzer/smokeping # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/ChangeLog,v 1.41 2012/06/12 03:14:47 zmedico Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/ChangeLog,v 1.42 2012/08/29 13:34:31 klausman Exp $ + + 29 Aug 2012; Tobias Klausmann <klausman@gentoo.org> +files/smokeping.init.3: + Add missing init script. Also, CVS is dumb and should be hated. 12 Jun 2012; Zac Medico <zmedico@gentoo.org> smokeping-2.4.2-r3.ebuild, smokeping-2.4.2-r4.ebuild: @@ -179,4 +182,3 @@ +smokeping-2.0.9.ebuild: Add package, closes bug #66980. Thanks to Lee Thompson and Steve Clement for the initial ebuild. - diff --git a/net-analyzer/smokeping/files/smokeping.init.3 b/net-analyzer/smokeping/files/smokeping.init.3 new file mode 100755 index 000000000000..8d0109fa8f8b --- /dev/null +++ b/net-analyzer/smokeping/files/smokeping.init.3 @@ -0,0 +1,77 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_commands="${opts} dump reload restore" + +depend() { + need net + use dns +} + +checkconfig() { + if [ ! -f "/etc/smokeping/config" ] ; then + eerror "You need /etc/smokeping/config to run smokeping!" + return 1 + fi +} + +start() { + checkconfig || return 1 + + if [ ! -d /var/run/smokeping/ ]; then + mkdir /var/run/smokeping/ + fi + chown smokeping:smokeping /var/run/smokeping/ + + ebegin "Starting smokeping" + LC_ALL=C \ + start-stop-daemon --start --name smokeping \ + --pidfile /var/run/smokeping/smokeping.pid \ + --exec /usr/bin/smokeping \ + --user smokeping:smokeping + eend $? +} + +stop() { + ebegin "Stopping smokeping" + start-stop-daemon --stop \ + --pidfile /var/run/smokeping/smokeping.pid + eend $? +} + +reload() { + ebegin "Reloading smokeping" + /usr/bin/smokeping --reload 1>/dev/null 2>&1 + eend $? +} + +dump() { + ebegin "Dumping smokeping rrd files to XML for backup or upgrade use" + if service_started "${myservice}" ; then + eerror "You need to stop smokeping before dumping files!" + return 1 + fi + for f in `find /var/lib/smokeping -name '*.rrd' -print` ; do + f_xml=`dirname $f`/`basename $f .rrd`.xml + rrdtool dump "$f" > "${f_xml}" + chown root:0 "${f_xml}" + done + eend $? +} + +restore() { + ebegin "Restoring smokeping rrd files from XML dump files" + if service_started "${myservice}" ; then + eerror "You need to stop smokeping before restoring files!" + return 1 + fi + for f in `find /var/lib/smokeping -name '*.xml' -print` ; do + f_rrd=`dirname $f`/`basename $f .xml`.rrd + mv -f "${f_rrd}" "${f_rrd}.bak" + chown root:0 "${f_rrd}.bak" + rrdtool restore "$f" "${f_rrd}" + chown smokeping:smokeping "${f_rrd}" + done + eend $? +} |