diff options
author | Tiago Cunha <tcunha@gentoo.org> | 2008-11-17 00:00:46 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gentoo.org> | 2008-11-17 00:00:46 +0000 |
commit | ee5b287f496ebc4a8764123ba25ba83d4c4a6324 (patch) | |
tree | 0f56106f556079fc4d79a29acde5c0eff8ab8194 /net-analyzer/symon | |
parent | skencil: change to use-dependencies (diff) | |
download | historical-ee5b287f496ebc4a8764123ba25ba83d4c4a6324.tar.gz historical-ee5b287f496ebc4a8764123ba25ba83d4c4a6324.tar.bz2 historical-ee5b287f496ebc4a8764123ba25ba83d4c4a6324.zip |
Improve init scripts by completing dependency information, and by adding the reload option
Package-Manager: portage-2.1.4.5
Diffstat (limited to 'net-analyzer/symon')
-rw-r--r-- | net-analyzer/symon/ChangeLog | 13 | ||||
-rw-r--r-- | net-analyzer/symon/Manifest | 7 | ||||
-rw-r--r-- | net-analyzer/symon/files/symon-init.d | 23 | ||||
-rw-r--r-- | net-analyzer/symon/files/symux-init.d | 23 | ||||
-rw-r--r-- | net-analyzer/symon/symon-2.79-r5.ebuild | 128 |
5 files changed, 178 insertions, 16 deletions
diff --git a/net-analyzer/symon/ChangeLog b/net-analyzer/symon/ChangeLog index dc6b92b6ccfb..2b657d1f2cc0 100644 --- a/net-analyzer/symon/ChangeLog +++ b/net-analyzer/symon/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for net-analyzer/symon # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/symon/ChangeLog,v 1.4 2008/11/09 21:35:12 tcunha Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/symon/ChangeLog,v 1.5 2008/11/17 00:00:46 tcunha Exp $ + +*symon-2.79-r5 (17 Nov 2008) + + 17 Nov 2008; Tiago Cunha <tcunha@gentoo.org> files/symon-init.d, + files/symux-init.d, +symon-2.79-r5.ebuild: + Improve the init scripts by: + - depending on localmount (both daemons need to write to local disks). + - starting after bootmisc (both daemons place a pidfile in /var/run). + - using the system logger. + - introducing the reload option which sends a SIGHUP to the daemons. + - removing the quiet flag to avoid hiding useful information. 09 Nov 2008; Tiago Cunha <tcunha@gentoo.org> metadata.xml: Update my email address. Thanks pva diff --git a/net-analyzer/symon/Manifest b/net-analyzer/symon/Manifest index d1bb5ffbcd9e..5bb0f456611b 100644 --- a/net-analyzer/symon/Manifest +++ b/net-analyzer/symon/Manifest @@ -1,9 +1,10 @@ -AUX symon-init.d 384 RMD160 779f0410c9ef4ec7ff83a8c4bd80949edd9ee5df SHA1 a60201406a2072a24458fc4ab6ef7af1a35e1c86 SHA256 13b9d627df34708ae4f436a8d10729c809f71d05ecd9f593a47cd6bf161eff28 +AUX symon-init.d 680 RMD160 b944a18cefedc75a17f4cba0a7d9f824cf2ab8ab SHA1 dfb1407601ca74be7e1f5e2b5ce6fd7bf05c5c95 SHA256 5c6f83290aec327de26cce51de1121528e217ba37e8f4f93447925ff4b8dc19c AUX symon-symon.conf.patch 669 RMD160 b0f53dfbf6eaba2c292e6e9f9f91625f26498683 SHA1 5523fbc4db46114197c3e020c74c72822b93e545 SHA256 603b471778ec84f2ebbb57b5718a8624fb748ca5c6dde36f4943156acf9a2b10 AUX symon-symux.conf.patch 1858 RMD160 8882ef430e763791a47be90a1460f85550cc3e8b SHA1 0734a88eb4e4da0e91909c2120ebd7cf349e025c SHA256 d8e12296c32a302d0dda1c2d9f20782a6bdb1b87a65795e90775418bbc3a5f54 -AUX symux-init.d 378 RMD160 438f3ee87579117db71fa346cd333cc4740b8a35 SHA1 bc5edf413f24aed698147767447f0266c4374415 SHA256 f887ab858987fc6f0984cba93dddbb1c82fb1ed515340002e373c0aa4541e584 +AUX symux-init.d 674 RMD160 1de1e203dd711df1cfdc95beef65c02ade32976b SHA1 2c0da16555cb9a965f89ed3dd904638e560389ee SHA256 a985bfb53ea2bfcc47a57d5b10ec8411853795a11a6892caaa974ddfecce75dd DIST symon-2.79.tar.gz 102400 RMD160 693b798cd6c564f4e8b79c62c1776f5b036aaf1a SHA1 a21566f3291baaa39806bec32550d5a28a163213 SHA256 7157b087b99a59f3aba9a02c375fb1b411dc4329463f748d2323c3cdf3d0cd83 EBUILD symon-2.79-r3.ebuild 3022 RMD160 9cfaf95e29b3666de07311926274f99a69180a45 SHA1 48b0c74491678908e648a2fe65ad4fd13228fef7 SHA256 a8d5df109e8e9b1e64c6a366f160d2b7ed0b4306ef4449cbe566265fb38af331 EBUILD symon-2.79-r4.ebuild 3602 RMD160 a416442f75fdbebf03ddfa5bd1c378de574054ec SHA1 e634ee091705db8c121bec2fd45b0cd6bf438839 SHA256 4fcebdf5d977ebd8ee230298c71f95ab6679edfd9c4392a90a82b93f88c1039e -MISC ChangeLog 7418 RMD160 c48256b20b513c2b645da20ce8892d18b8a4278e SHA1 efc1b12e7f2944b41ae156e7ed3be364ad349594 SHA256 9bdf23c19d6a0846dba3bdaf406b1ecfbe7531bcd463b416d81f5517b14a38d7 +EBUILD symon-2.79-r5.ebuild 3605 RMD160 3daeb5ea01c6e0f62fbb87ad01a8e74fb1e85bca SHA1 42fa6880646bf79ed0a56d034310de9d232b1179 SHA256 641df5e5459cf5afa4414c47a2dab5768a79edcaa5c3e9be2bbbb191e956dabe +MISC ChangeLog 7901 RMD160 96e0d1300136bee45a431ab6cd687d2cc7da2347 SHA1 60402f5d7686b0ccedffbfb2a3283c05f2083716 SHA256 d513eba8e88c30eb7645af6c1daec1625f87438167576ffea731ce2316fe1e10 MISC metadata.xml 460 RMD160 4e9b402a52364f0357bbfb41c70c908e7e75a3bd SHA1 d51eed16c1ba7952bf568156edbcdd56db95d7da SHA256 af13522d8ef8b2c8ec3945468144b34c7893b853b421c6f001ed4e253130b7e2 diff --git a/net-analyzer/symon/files/symon-init.d b/net-analyzer/symon/files/symon-init.d index 7e9a31a689a0..d4f4b3dd0550 100644 --- a/net-analyzer/symon/files/symon-init.d +++ b/net-analyzer/symon/files/symon-init.d @@ -1,20 +1,31 @@ #!/sbin/runscript # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/symon/files/symon-init.d,v 1.2 2008/11/17 00:00:46 tcunha Exp $ + +opts="${opts} reload" depend() { - need net + after bootmisc + need localmount net + use logger +} + +reload() { + ebegin "Reloading symon" + start-stop-daemon --stop --pidfile /var/run/symon.pid \ + --exec /usr/sbin/symon --oknodo --signal HUP + eend $? } start() { ebegin "Starting symon" - start-stop-daemon --start --quiet --exec /usr/sbin/symon -- -u - eend ${?} + start-stop-daemon --start --exec /usr/sbin/symon -- -u + eend $? } stop() { ebegin "Stopping symon" - start-stop-daemon --stop --quiet --pidfile /var/run/symon.pid - eend ${?} + start-stop-daemon --stop --pidfile /var/run/symon.pid + eend $? } diff --git a/net-analyzer/symon/files/symux-init.d b/net-analyzer/symon/files/symux-init.d index 58df4c51b360..b7c10e4fa489 100644 --- a/net-analyzer/symon/files/symux-init.d +++ b/net-analyzer/symon/files/symux-init.d @@ -1,20 +1,31 @@ #!/sbin/runscript # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/symon/files/symux-init.d,v 1.2 2008/11/17 00:00:46 tcunha Exp $ + +opts="${opts} reload" depend() { - need net + after bootmisc + need localmount net + use logger +} + +reload() { + ebegin "Reloading symux" + start-stop-daemon --stop --pidfile /var/run/symux.pid \ + --exec /usr/sbin/symux --oknodo --signal HUP + eend $? } start() { ebegin "Starting symux" - start-stop-daemon --start --quiet --exec /usr/sbin/symux - eend ${?} + start-stop-daemon --start --exec /usr/sbin/symux + eend $? } stop() { ebegin "Stopping symux" - start-stop-daemon --stop --quiet --pidfile /var/run/symux.pid - eend ${?} + start-stop-daemon --stop --pidfile /var/run/symux.pid + eend $? } diff --git a/net-analyzer/symon/symon-2.79-r5.ebuild b/net-analyzer/symon/symon-2.79-r5.ebuild new file mode 100644 index 000000000000..1d467e66d417 --- /dev/null +++ b/net-analyzer/symon/symon-2.79-r5.ebuild @@ -0,0 +1,128 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/symon/symon-2.79-r5.ebuild,v 1.1 2008/11/17 00:00:46 tcunha Exp $ + +EAPI=1 + +inherit eutils perl-module toolchain-funcs + +DESCRIPTION="Performance and information monitoring tool" +HOMEPAGE="http://www.xs4all.nl/~wpd/symon/" +SRC_URI="http://www.xs4all.nl/~wpd/symon/philes/${P}.tar.gz" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~amd64 ~sparc ~x86" +IUSE="perl +symon symux" + +RDEPEND="perl? ( dev-lang/perl ) + symux? ( net-analyzer/rrdtool )" +DEPEND="${RDEPEND} + virtual/pmake" + +S=${WORKDIR}/${PN} + +build_symon() { + [[ -n "${BUILD_SYMON}" ]] && return 0 || return 1 +} + +zap_subdir() { + sed -i "/SUBDIR/s/$1//" "${S}"/Makefile || die "sed $1 failed" +} + +pkg_setup() { + if ! use perl && ! use symon && ! use symux ; then + ewarn "You have perl, symon, and symux USE flags disabled." + ewarn "That means I have nothing to install but, I'll emerge the" + ewarn "system monitor as default. Please, enable at least one USE" + ewarn "flag to avoid this message." + BUILD_SYMON=YES + fi + use symon && BUILD_SYMON=YES +} + +src_unpack() { + unpack ${A} + + build_symon && epatch "${FILESDIR}"/${PN}-symon.conf.patch + use symux && epatch "${FILESDIR}"/${PN}-symux.conf.patch + + sed -i '/${CC}.*${LIBS}/s/${CC}/& ${LDFLAGS}/' \ + "${S}"/sym{on,ux}/Makefile || die "sed ldflags failed" + + use perl && ! use symon && ! use symux && zap_subdir lib + ! use perl && zap_subdir client + ! use symux && zap_subdir symux + build_symon || zap_subdir symon +} + +src_compile() { + MAKE=pmake MAKEOPTS= emake \ + AR="$(tc-getAR)" \ + CC="$(tc-getCC)" \ + CFLAGS+="${CFLAGS}" \ + RANLIB="$(tc-getRANLIB)" \ + STRIP=true || die "emake failed" +} + +src_install() { + if use perl ; then + dobin client/getsymonitem.pl || die "dobin getsymonitem.pl failed" + + perlinfo + insinto ${SITE_LIB} + doins client/SymuxClient.pm || die "doins SymuxClient.pm failed" + fi + + if build_symon ; then + insinto /etc + doins symon/symon.conf || die "doins symon.conf failed" + + newinitd "${FILESDIR}"/${PN}-init.d ${PN} || die "newinitd symon failed" + + dodoc CHANGELOG HACKERS TODO || die "dodoc failed" + + doman symon/symon.8 || die "doman symon failed" + dosbin symon/symon || die "dosbin symon failed" + + dodir /usr/share/symon + insinto /usr/share/symon + doins symon/c_config.sh || die "doins c_config.sh failed" + fperms a+x,u-w /usr/share/symon/c_config.sh + fi + + if use symux ; then + insinto /etc + doins symux/symux.conf || die "doins symux.conf failed" + + newinitd "${FILESDIR}"/symux-init.d symux || die "newinitd symux failed" + + doman symux/symux.8 || die "doman symux failed" + dosbin symux/symux || die "dosbin symux failed" + + insinto /usr/share/symon + doins symux/c_smrrds.sh || die "doins c_smrrds.sh failed" + fperms u-w,u+x /usr/share/symon/c_smrrds.sh + + dodir /var/lib/symon/rrds/localhost + fi +} + +pkg_postinst() { + use perl && perl-module_pkg_postinst + + if build_symon ; then + elog "Before running the monitor, edit /etc/symon.conf. To test your" + elog "configuration file, run symon -t." + elog "NOTE that symon won't chroot by default." + fi + + if use symux ; then + elog "Before running the data collector, edit /etc/symux.conf." + elog "To create the RRDs run /usr/share/symon/c_smrrds.sh all. Then," + elog "to test your configuration file, run symux -t." + elog "For information about migrating RRDs from a previous symux" + elog "version read the LEGACY FORMATS section of symux(8)." + elog "To view the rrdtool pictures of the stored data, emerge syweb." + fi +} |