diff options
author | Peter Volkov <pva@gentoo.org> | 2010-06-16 18:24:17 +0000 |
---|---|---|
committer | Peter Volkov <pva@gentoo.org> | 2010-06-16 18:24:17 +0000 |
commit | 2a55e0eccc521e677f65bf3ef0f9035cfa6c21b8 (patch) | |
tree | 7212c6e26113751cb9c73bb053947291c3400741 /net-analyzer | |
parent | Fix bug #324267 and rename system-lib patch (diff) | |
download | gentoo-2-2a55e0eccc521e677f65bf3ef0f9035cfa6c21b8.tar.gz gentoo-2-2a55e0eccc521e677f65bf3ef0f9035cfa6c21b8.tar.bz2 gentoo-2-2a55e0eccc521e677f65bf3ef0f9035cfa6c21b8.zip |
Create /var/run/smokeping directory at init.d script start as FSH suggests. Fix permissions of that directory, bug #324177, thank Weeve for report.
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'net-analyzer')
-rw-r--r-- | net-analyzer/smokeping/ChangeLog | 10 | ||||
-rw-r--r-- | net-analyzer/smokeping/files/smokeping.init.2 | 77 | ||||
-rw-r--r-- | net-analyzer/smokeping/smokeping-2.4.2-r2.ebuild (renamed from net-analyzer/smokeping/smokeping-2.4.2.ebuild) | 25 |
3 files changed, 98 insertions, 14 deletions
diff --git a/net-analyzer/smokeping/ChangeLog b/net-analyzer/smokeping/ChangeLog index d1d8700c4f9e..b146e0c2f0af 100644 --- a/net-analyzer/smokeping/ChangeLog +++ b/net-analyzer/smokeping/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for net-analyzer/smokeping # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/ChangeLog,v 1.29 2010/06/02 06:29:54 tove Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/ChangeLog,v 1.30 2010/06/16 18:24:17 pva Exp $ + +*smokeping-2.4.2-r2 (16 Jun 2010) + + 16 Jun 2010; Peter Volkov <pva@gentoo.org> -smokeping-2.4.2.ebuild, + +smokeping-2.4.2-r2.ebuild, +files/smokeping.init.2: + Create /var/run/smokeping directory at init.d script start as FSH + suggests. Fix permissions of that directory, bug #324177, thank Weeve for + report. 02 Jun 2010; Torsten Veller <tove@gentoo.org> metadata.xml: Remove chtekk from metadata.xml (#103720) diff --git a/net-analyzer/smokeping/files/smokeping.init.2 b/net-analyzer/smokeping/files/smokeping.init.2 new file mode 100644 index 000000000000..068f33ff25ce --- /dev/null +++ b/net-analyzer/smokeping/files/smokeping.init.2 @@ -0,0 +1,77 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +opts="${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 \ + --chuid 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 $? +} diff --git a/net-analyzer/smokeping/smokeping-2.4.2.ebuild b/net-analyzer/smokeping/smokeping-2.4.2-r2.ebuild index 155acbf350ca..7d92b6c9035c 100644 --- a/net-analyzer/smokeping/smokeping-2.4.2.ebuild +++ b/net-analyzer/smokeping/smokeping-2.4.2-r2.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/smokeping-2.4.2.ebuild,v 1.3 2009/03/07 12:57:43 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/smokeping-2.4.2-r2.ebuild,v 1.1 2010/06/16 18:24:17 pva Exp $ EAPI="2" @@ -15,17 +15,22 @@ SLOT="0" KEYWORDS="~amd64 ~hppa ~sparc ~x86" IUSE="apache2 speedy" +# dev-perl/JSON-1.x is bundled and is incompatible with version 2.x wich is in +# the tree. See http://bugs.gentoo.org/show_bug.cgi?id=260170#c2 DEPEND="dev-lang/perl virtual/perl-libnet >=net-analyzer/rrdtool-1.2[perl] >=net-analyzer/fping-2.4_beta2-r2 dev-perl/Digest-HMAC dev-perl/libwww-perl + dev-perl/CGI-Session + >=dev-perl/SNMP_Session-1.13 dev-perl/Socket6 dev-perl/Net-DNS speedy? ( dev-perl/SpeedyCGI ) !apache2? ( virtual/httpd-cgi ) - apache2? ( >=www-apache/mod_perl-2.0.1 )" + apache2? ( >=www-apache/mod_perl-2.0.1 ) + !dev-perl/JSON" RDEPEND="${DEPEND}" @@ -34,14 +39,10 @@ pkg_preinst() { enewuser smokeping -1 -1 /var/lib/smokeping smokeping } -src_unpack() { - # perl-mod.eclass does not support EAPI=2. - unpack ${A} -} - src_prepare() { - # we depend on dev-perl/Digest-HMAC. No need for bundled version. - rm -rf lib/Digest + rm -rf lib/Digest # provided by dev-perl/Digest-HMAC + rm -rf lib/CGI # provided by dev-perl/CGI-Session + rm -r lib/{BER.pm,SNMP_Session.pm,SNMP_util.pm} # dev-perl/SNMP_Session rm qooxdoo/qooxdoolink } @@ -101,7 +102,7 @@ src_install() { sed -e '/^<script/{s:cropper/:/cropper/:}' -i "${D}/etc/${PN}/basepage.html" fperms 700 /etc/${PN}/smokeping_secrets - newinitd "${FILESDIR}/${PN}.init.1" ${PN} || die + newinitd "${FILESDIR}/${PN}.init.2" ${PN} || die if use apache2 ; then insinto /etc/apache2/modules.d @@ -117,8 +118,6 @@ src_install() { fowners smokeping:smokeping /var/lib/${PN}/.simg fi fperms 775 /var/lib/${PN} /var/lib/${PN}/.simg - keepdir /var/run/${PN} # for pid files - fowners smokeping:smokeping /var/run/${PN} # Install documentation. insinto "/usr/share/doc/${PF}" |