diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2013-01-10 13:11:37 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2013-01-10 13:11:37 +0000 |
commit | c8dddcf140666a9be826d4ceee41364452d46172 (patch) | |
tree | 542bdebcf98a83b44e49abb75b9deed403e54d03 /net-analyzer/munin | |
parent | Restrict gprolog compile to single instance of gplc as it cannot safely be ru... (diff) | |
download | historical-c8dddcf140666a9be826d4ceee41364452d46172.tar.gz historical-c8dddcf140666a9be826d4ceee41364452d46172.tar.bz2 historical-c8dddcf140666a9be826d4ceee41364452d46172.zip |
Version bump.
Package-Manager: portage-2.2.0_alpha149/cvs/Linux x86_64
Manifest-Sign-Key: 0x1CD13C8AD4301342
Diffstat (limited to 'net-analyzer/munin')
-rw-r--r-- | net-analyzer/munin/ChangeLog | 9 | ||||
-rw-r--r-- | net-analyzer/munin/Manifest | 19 | ||||
-rw-r--r-- | net-analyzer/munin/munin-2.0.10.ebuild | 386 |
3 files changed, 404 insertions, 10 deletions
diff --git a/net-analyzer/munin/ChangeLog b/net-analyzer/munin/ChangeLog index 7c6921684131..8383e1000349 100644 --- a/net-analyzer/munin/ChangeLog +++ b/net-analyzer/munin/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for net-analyzer/munin -# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/ChangeLog,v 1.130 2012/12/31 12:53:46 flameeyes Exp $ +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/ChangeLog,v 1.131 2013/01/10 13:11:31 flameeyes Exp $ + +*munin-2.0.10 (10 Jan 2013) + + 10 Jan 2013; Diego E. Pettenò <flameeyes@gentoo.org> +munin-2.0.10.ebuild: + Version bump. 31 Dec 2012; Diego E. Pettenò <flameeyes@gentoo.org> munin-2.0.9-r1.ebuild: Make sure to create /var/run/munin on pkg install. Fixes bug #449438. diff --git a/net-analyzer/munin/Manifest b/net-analyzer/munin/Manifest index 35d155899501..aead3b54cdb0 100644 --- a/net-analyzer/munin/Manifest +++ b/net-analyzer/munin/Manifest @@ -9,22 +9,25 @@ AUX munin-node_conf.d_1.4.6-r2 316 SHA256 cf250f39eae1ee564f51cd99ec20510accb8a6 AUX munin-node_init.d_2.0.7 859 SHA256 26b490cc4c5023c3797714ead05fc4a3bef06caad96c8b2211ccbeeec1081098 SHA512 09f8da4c1ad07d38bac3b1fe81818c1c29a3a32dc6410104afdbcfb853af2455bf7a2ab9caad21ead3aba937dabb29a9b8c962716dcfa9d491c67bb29e331180 WHIRLPOOL bdbed8b90748cf4f216c38c2dd96b7de5420ae25b11342829047e9484f80e30b7be0d30f2496f0992c6463529d29af05ca29a378d88d794d221b6c5c1d5059f9 AUX munin.apache.include 604 SHA256 5051ff79220e5ef578e6e5fa66ef8b0a71b72cca6fde93264cf371585f56cb52 SHA512 de4797ccac5c9299dd55140300276f746febf3ac5bfebfc48901ca71fa0e035017917eba054b251cc2383c65f1e209e244906b34eebad237f43a7bd7171f6087 WHIRLPOOL 5adfbcc61a3e5f7b6bec7396ca72bf24fd59406ee2a49ac47dc81dfff2eef98e688b6fa6699a9095f34943dd7df2ee1f392e1f7a9c1572dc0505d2439a836c5c AUX munin.apache.include-2.4 577 SHA256 21245e9eb7b759d2d2e65c2d1424da6d8c6fd8f49ec2f30cf72696cfc4227694 SHA512 b07791a4d5b822b5d0ad84ddbea3444cc1475cee8ee20f62dbb5f3a1792b71dba995e412433d30b3c295e40ad5346528d25e04438ec2dfa535983aae9198cea4 WHIRLPOOL 90a166f400e8336792fabcbcb786169dc5ed6b5fe9151ac5aef40f85c8d3f2724a6fffe17e41d90f31948a9462fc619fe45747caf8f62d55f6d494d48a7a2bb1 +DIST munin-2.0.10-gentoo-1.tar.xz 11688 SHA256 8e7e77d056b687bc0fd588274b7da9bad8682446374d92d82cb622580eb7e590 SHA512 7b4fbabe9303ea18659c408d34c310036761fc4c79f0beca06eb3715938347f8b6684dcbf53ed2051d60eb9e625872f05f5c574892e79abdb3c331b78a1dcf8b WHIRLPOOL a9dd95b9c3b69e43af4b083abe80bd6c2858c78bc1c64827bac18d4b24628ca6aa4948aece74a407a454eaa252a81d482ac4c0c1fd91768e1c2fef7698d67df2 +DIST munin-2.0.10.tar.gz 1330859 SHA256 ba5339607a584ae5fa5c2a35de452f024574ea2558ebde4a4feee95f1ff219af SHA512 7976c9bf00c213270baec7c0832fdec50b7560006ed1a738ac4dcb33068c1bdf9dbd7f70a4e970d06121bb637e2c54f2e90a7a52d343c1ed75f5129888ba575d WHIRLPOOL 27e1196ffc288de5064c48175b7b739aa8a12164c1a300912953f666dde825a16deed120a3b8b19151496df4ed4b42b10581455963eb6218b8960e053f5a5eb3 DIST munin-2.0.8-patches-4.tar.xz 16600 SHA256 badd20ae9d7d74667b6a96764c8caaf156e34aa22be5bb08c10535270a99f3d3 SHA512 81084c9b46127f425c89ff76a0c807bbc36859b2fd7ac37734bd202cae92610333f4793aa4630595147d96ad9099da99283c7bcf107351d6ec4931e64451a415 WHIRLPOOL 7e7aed4f0e23f88b0fa2eba548af5573d3e1fab20a910a8568c641ae539c58acc9e020eec01a3323243d6f6ae6f69dd7200818df3a14b5ca3b7100557fc4c8dd DIST munin-2.0.8.tar.gz 1328805 SHA256 ae645daee35214c1ba3d771d990fa781df741751b7b79e9d9fe48c583890dca6 SHA512 f767e586aee68c389ce0ae250376bc43d6bfe73df8e193bb7ba8b373d887301e0c1d3574c3fe456be3b93dc86cc8ec8ce27e3c36836a0048b80afb55a3a3cc1e WHIRLPOOL 312f006c21af98f5d9e548a77d43fe7396dcc69072e06faedb3d8262e70599da91bfecdfd06e859d6ff8706506e73308cbcac38e658a28e428fd50399f3f3c3e DIST munin-2.0.9-patches-2.tar.xz 11344 SHA256 a9b4c40b36aece16fb2c669a76ca9b01e5b1bcbade16a3b928b148cdc0c11ace SHA512 f3d7a8bc3ea95222fce2ea13a4405b6a75464b55cc740d24a7f6733b29090e6d747628363d2cd64916cf1d1ae52eb085d7553f5d92d60e9dd75f6bdaa7a4c93c WHIRLPOOL 7e9a00e5876dedb5af6783d0629062387f03f12a1424cfd40f39c6863c4af8f5eb223dd82d8d05fe7309a9fa5ec3e0d680c6075d84c39948635b6e112b6c5b08 DIST munin-2.0.9.tar.gz 1328972 SHA256 6bb2b42de29a438ad80f1d6c53f4a35e9a74cb5a2103ea7a9530cba2d75c7309 SHA512 3db797283fc8ee8042869ace9c24871a8317fe0f826a4f8a3cebe1152ab621b62e2ddfd44a32a7516dabdaf44e4dde6aeaae014674cb544328665b63990c16d0 WHIRLPOOL 4110992995ac52f7903573b809a776281fe48e0406944b127ee8b2fede3ab12deef98f578070466721c72efc7a6418e9dc872d2fdfe1d4d5690f1648e33e49c1 +EBUILD munin-2.0.10.ebuild 11743 SHA256 5d1ecd8ea1c0e968b1a43f860cba769222fe13c55ec08402721dd20c5599b6e7 SHA512 a66234b2cb7005b40c4d4f579b4adea68060333202a0b3919173fe5fd43dd8d02e76cd9be165713ebe1988b8493e2f73226df0448e817d72813839924d40980f WHIRLPOOL dc22742fdeb84f3ec703291027c08a07960d74dcd690b37d4acdd13b6243886866624acc337e467d3c1fd4d2422cd17d8b3f0f9c57e5071ed0864ea01fa12a07 EBUILD munin-2.0.8-r2.ebuild 11318 SHA256 d37a81dbb917c080a95715b94a59323788122134950687007359f01a670e2910 SHA512 e63dc6a07ccb81c03ede5b0a3707c59818e1f5fa1e6a4c81195d48747093666384ad2f2a059d14afeaf2179bc126e01aecfce9d24852be4aa1c24d3fc7421e5f WHIRLPOOL 1d59a9da10590b8cd659d1df4bb81d1e926191450034f867b61e27c47f11fde4c30abfcb7632aa26c205a126b26f75420528ea13c9253f8bbcd7b039aa5c2452 EBUILD munin-2.0.9-r1.ebuild 11746 SHA256 17292ff7bc3821bfa8a7e9af0e68b5853b9e0b32cfb95da2e4269a655ab1c235 SHA512 712fb4892c99b424fb55af3d500fd637e7207feb8b7ed6610bd85695493a23cbf9b4524b638e5f44e508ee560fb7152e214f978b6ba66884a22dbdb08c50e4cd WHIRLPOOL cfdd548a2af88b58c241d83f7e50bb38cb7a0001935706b0f8517a9c1392480f445cc92c0aeaa5696b3023cfaeae3cde1852cbc8fdf6a75fdeef4d8341d49c39 -MISC ChangeLog 28717 SHA256 2fb360c2a61af5b99f7a49ee1f70ca76b440cd166045d562ab51ff3b2814cec1 SHA512 c7a22c7525f028b64ae07f1e12376e2470c319a2264a8ba2f12a05b6fb1b99449e1e4fb7ffcb050820760fd1a4a5f764277a4748c51cc66dab57ae65f25889af WHIRLPOOL 72449845e10ebdf931bef7e68b8a5bcdd488e72dd31b1d0a3baec395d4b997abaeb64ace593201d2318d55b32524a1df8eaaf54021aa1c9af133a1a8f8fa0568 +MISC ChangeLog 28841 SHA256 4a94b4347710923bd25619223d5e8be4ba74b0c1c2c835d6fb1948ae0b31f3ad SHA512 2cfc79611e67f4725f389a27c5b3db4c6295612022cbc693ea12492dd7c141632e08a51db2818d9288cf61809164fd31290f5be58192681554d93e8c6c450ee3 WHIRLPOOL 571703687ae8f43802056db0e47a50b5cb6642231acf05b7c8909442432274d9c48c531ca52b5a5c06202e525b2359287136ed08d35f38f33245ea967cf8d858 MISC metadata.xml 3824 SHA256 5b838f6ccb778750cbcc41052480daaa9ebcbee5ee38ab66b054472b6313d177 SHA512 277f3ab9589982617b60ce8ea63802288dc4ff5368416a942f3670804a8e0a4cd481b2d0ff91302be040d2aba4f66a2e11b0c181164e6285dc33b150b263da60 WHIRLPOOL 7486ffd90f12e32a9feb557b4937397317cfd4325e5ffdf1dbaa749a90f3c47f797baea306585ac4a200e4a23901da1de10a9f0b951a15bd27f8a7c876c504a5 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) -iQEcBAEBCAAGBQJQ4YrtAAoJEBzRPIrUMBNCLJoH/0aFaiM8xcddtiKfJ8LZhFxz -V3xy4k1R/cbZPBmpMClH4+PhXaXEbBjycxxflOeOqbJq6ZmGkpzbvHYUrjPpTQQu -ETuTfg83qwENubIxkEcCfTQ4nUkbN4xalFZq1eHX8gGmTE60IDg5BryrzVVsqFw6 -WSUOZwyPvfqk03hd6mr8q905TjeJcCkdySnBcX5c/q/INVJNaqiGiFM3FW4nxmbi -JCkO0lJSDIbWmdzOj1eKfsV511GbTUMoNxR37xvfxrOcLcf9IRI5uwtp5oNwgdHg -nK5/CzRboP8QnAoooRvaDGYWjtH9WSLuVJklY1sI6T3Gv3XyEsxP1FQDp84I/Ww= -=c6aD +iQEcBAEBCAAGBQJQ7r4IAAoJEBzRPIrUMBNC8oEIAKT1GlXrasKxZJMdDF+uc8Dc +w1vvGGRSm6fVpqoi8zO/e5qGuBeMFFwb0A8FmQvJNWvS7Vlg4yHEYBeN8XepBgzD +ZpKOusX/U08TwkSN+QEM1iOSDSrPw0TdUysT7RRUy16FZd/HWq4gJ/Vz5nB7ubrU +9u1Z35pIJiT2BfY7l0OpBRt3TGcRG0A0u9lbrSfJJVnctOVjDV3TQHxI8qGrVSyj +y4isimEGG5lwvRZYFtDbglvLYBvFW6XSat3bq0AUBH0Q2utApi/pv9gNUXYf4Q9o +hl2ivfwXB/H7sC2g/h4v/2DUcfbggY3XyorDVGXW8TNeY0MZ2ufijOcj9TN5B3s= +=q5EM -----END PGP SIGNATURE----- diff --git a/net-analyzer/munin/munin-2.0.10.ebuild b/net-analyzer/munin/munin-2.0.10.ebuild new file mode 100644 index 000000000000..8687aeb174ed --- /dev/null +++ b/net-analyzer/munin/munin-2.0.10.ebuild @@ -0,0 +1,386 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/munin-2.0.10.ebuild,v 1.1 2013/01/10 13:11:31 flameeyes Exp $ + +EAPI=5 + +PATCHSET=1 + +inherit eutils user java-pkg-opt-2 + +MY_P=${P/_/-} + +DESCRIPTION="Munin Server Monitoring Tool" +HOMEPAGE="http://munin-monitoring.org/" +SRC_URI="mirror://sourceforge/munin/${MY_P}.tar.gz + http://dev.gentoo.org/~flameeyes/${PN}/${P}-gentoo-${PATCHSET}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~mips ~ppc ~x86" +IUSE="asterisk irc java memcached minimal mysql postgres ssl test cgi ipv6 syslog ipmi http dhcpd doc apache" +REQUIRED_USE="cgi? ( !minimal ) apache? ( cgi )" + +# Upstream's listing of required modules is NOT correct! +# Some of the postgres plugins use DBD::Pg, while others call psql directly. +# Some of the mysql plugins use DBD::mysql, while others call mysqladmin directly. +# We replace the original ipmi plugins with the freeipmi_ plugin which at least works. +DEPEND_COM="dev-lang/perl[berkdb] + sys-process/procps + doc? ( dev-python/sphinx ) + asterisk? ( dev-perl/Net-Telnet ) + irc? ( dev-perl/Net-IRC ) + mysql? ( virtual/mysql + dev-perl/Cache-Cache + dev-perl/DBD-mysql ) + ssl? ( dev-perl/Net-SSLeay ) + postgres? ( dev-perl/DBD-Pg dev-db/postgresql-base ) + memcached? ( dev-perl/Cache-Memcached ) + cgi? ( dev-perl/FCGI ) + apache? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] ) + syslog? ( virtual/perl-Sys-Syslog ) + http? ( dev-perl/libwww-perl ) + dhcpd? ( + >=net-misc/dhcp-3[server] + dev-perl/Net-IP + dev-perl/HTTP-Date + ) + dev-perl/DBI + dev-perl/DateManip + dev-perl/File-Copy-Recursive + dev-perl/List-MoreUtils + dev-perl/Log-Log4perl + dev-perl/Net-CIDR + dev-perl/Net-Netmask + dev-perl/Net-SNMP + dev-perl/net-server[ipv6(-)?] + virtual/perl-Digest-MD5 + virtual/perl-Getopt-Long + virtual/perl-MIME-Base64 + virtual/perl-Storable + virtual/perl-Text-Balanced + virtual/perl-Time-HiRes + !minimal? ( + dev-perl/HTML-Template + dev-perl/IO-Socket-INET6 + dev-perl/URI + >=net-analyzer/rrdtool-1.3[perl] + virtual/ssh + )" + +# Keep this seperate, as previous versions have had other deps here +DEPEND="${DEPEND_COM} + virtual/perl-Module-Build + java? ( >=virtual/jdk-1.5 ) + test? ( + dev-perl/Test-Deep + dev-perl/Test-LongString + dev-perl/Test-Differences + dev-perl/Test-MockModule + dev-perl/Test-MockObject + dev-perl/File-Slurp + dev-perl/IO-stringy + dev-perl/IO-Socket-INET6 + )" +RDEPEND="${DEPEND_COM} + virtual/awk + ipmi? ( >=sys-libs/freeipmi-1.1.6-r1 ) + java? ( + >=virtual/jre-1.5 + || ( net-analyzer/netcat6 net-analyzer/netcat ) + ) + !minimal? ( + virtual/cron + media-fonts/dejavu + )" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + enewgroup munin + enewuser munin 177 -1 /var/lib/munin munin + enewuser munin-async -1 /bin/sh /var/spool/munin-async + esethome munin-async /var/spool/munin-async + java-pkg-opt-2_pkg_setup +} + +src_prepare() { + epatch "${WORKDIR}"/patches/*.patch + + java-pkg-opt-2_src_prepare +} + +src_configure() { + local cgidir='$(DESTDIR)/usr/libexec/munin/cgi' + use cgi || cgidir="${T}/useless/cgi-bin" + + local cgiuser=$(usex apache apache munin) + + cat - >> "${S}"/Makefile.config <<EOF +PREFIX=\$(DESTDIR)/usr +CONFDIR=\$(DESTDIR)/etc/munin +DOCDIR=${T}/useless/doc +MANDIR=\$(PREFIX)/share/man +LIBDIR=\$(PREFIX)/libexec/munin +HTMLDIR=\$(DESTDIR)/var/www/localhost/htdocs/munin +CGIDIR=${cgidir} +CGITMPDIR=\$(DESTDIR)/var/cache/munin-cgi +CGIUSER=${cgiuser} +DBDIR=\$(DESTDIR)/var/lib/munin +DBDIRNODE=\$(DESTDIR)/var/lib/munin-node +SPOOLDIR=\$(DESTDIR)/var/spool/munin-async +LOGDIR=\$(DESTDIR)/var/log/munin +PERLSITELIB=$(perl -V:vendorlib | cut -d"'" -f2) +JCVALID=$(usex java yes no) +EOF +} + +# parallel make and install need to be fixed before, and I haven't +# gotten around to do so yet. +src_compile() { + emake -j1 + if use doc; then + emake -C doc html + fi +} + +src_test() { + if [[ ${EUID} == 0 ]]; then + eerror "You cannot run tests as root." + eerror "Please enable FEATURES=userpriv before proceeding." + return 1 + fi + + local testtargets="test-common test-node test-plugins" + use minimal || testtargets+=" test-master" + + LC_ALL=C emake -j1 ${testtargets} +} + +src_install() { + local dirs=" + /var/log/munin + /var/lib/munin/plugin-state + /etc/munin/plugin-conf.d + /etc/munin/plugins" + use minimal || dirs+=" /etc/munin/munin-conf.d/" + + keepdir ${dirs} + fowners munin:munin ${dirs} + + # parallel install doesn't work and it's also pointless to have this + # run in parallel for now (because it uses internal loops). + emake -j1 DESTDIR="${D}" $(usex minimal install-minimal install) + + # we remove /var/run from the install as that stops Portage from + # having to check it for symlinks when the new /run is used. + rm -rf "${D}"/var/run + + # remove the plugins for non-Gentoo package managers + rm "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die + + insinto /etc/munin/plugin-conf.d/ + newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node + + newinitd "${FILESDIR}"/munin-node_init.d_2.0.7 munin-node + newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node + + newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd + + cat - >> "${T}"/munin.env <<EOF +CONFIG_PROTECT=/var/spool/munin-async/.ssh +EOF + newenvd "${T}"/munin.env 50munin + + dodoc README ChangeLog INSTALL + if use doc; then + cd "${S}"/doc/_build/html + dohtml -r * + cd "${S}" + fi + + dodir /etc/logrotate.d/ + sed -e "s:@CGIUSER@:$(usex apache apache munin):g" \ + "${FILESDIR}"/logrotate.d-munin.2 > "${D}"/etc/logrotate.d/munin + + dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_ + + if use syslog; then + sed -i -e '/log_file/s| .*| Sys::Syslog|' \ + "${D}"/etc/munin/munin-node.conf || die + fi + + # Use a simpler pid file to avoid trouble with /run in tmpfs. The + # munin-node service is ran as user root, and only later drops + # privileges. + sed -i -e 's:/var/run/munin/munin-node.pid:/var/run/munin-node.pid:' \ + "${D}"/etc/munin/munin-node.conf || die + + keepdir /var/spool/munin-async/.ssh + touch "${D}"/var/spool/munin-async/.ssh/authorized_keys + fowners munin-async:munin /var/spool/munin-async{,/.ssh/{,authorized_keys}} + fperms 0750 /var/spool/munin-async{,/.ssh} + fperms 0600 /var/spool/munin-async/.ssh/authorized_keys + + if use minimal; then + # This requires the presence of munin-update, which is part of + # the non-minimal install... + rm "${D}"/usr/libexec/munin/plugins/munin_stats + else + exeinto /etc/local.d/ + newexe "${FILESDIR}"/localstart-munin 50munin.start + + # remove font files so that we don't have to keep them around + rm "${D}"/usr/libexec/${PN}/*.ttf || die + + if use cgi; then + sed -i -e '/#graph_strategy cgi/s:^#::' "${D}"/etc/munin/munin.conf || die + + keepdir /var/cache/munin-cgi + touch "${D}"/var/log/munin/munin-cgi-{graph,html}.log + fowners $(usex apache apache munin) \ + /var/cache/munin-cgi \ + /var/log/munin/munin-cgi-{graph,html}.log + + if use apache; then + insinto /etc/apache2/vhosts.d + newins "${FILESDIR}"/munin.apache.include munin.include + newins "${FILESDIR}"/munin.apache.include-2.4 munin-2.4.include + fi + else + sed -i -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' "${D}"/etc/munin/munin.conf || die + fi + + keepdir /var/lib/munin/.ssh + cat - >> "${D}"/var/lib/munin/.ssh/config <<EOF +IdentityFile /var/lib/munin/.ssh/id_ecdsa +IdentityFile /var/lib/munin/.ssh/id_rsa +EOF + + fowners munin:munin /var/lib/munin/.ssh/{,config} + fperms go-rwx /var/lib/munin/.ssh/{,config} + + dodir /usr/share/${PN} + cat - >> "${D}"/usr/share/${PN}/crontab <<EOF +# Force the shell to bash +SHELL=/bin/bash +# Mail reports to root@, not munin@ +MAILTO=root + +# This runs the munin task every 5 minutes. +*/5 * * * * /usr/bin/munin-cron + +# Alternatively, this route works differently +# Update once a minute (for busy sites) +#*/1 * * * * /usr/libexec/munin/munin-update +## Check for limit excess every 2 minutes +#*/2 * * * * /usr/libexec/munin/munin-limits +## Update graphs every 5 minutes +#*/5 * * * * nice /usr/libexec/munin/munin-graph +## Update HTML pages every 15 minutes +#*/15 * * * * nice /usr/libexec/munin/munin-html +EOF + + cat - >> "${D}"/usr/share/${PN}/fcrontab <<EOF +# Mail reports to root@, not munin@, only execute one at a time +!mailto(root),serial(true) + +# This runs the munin task every 5 minutes. +@ 5 /usr/bin/munin-cron + +# Alternatively, this route works differently +# Update once a minute (for busy sites) +#@ 1 /usr/libexec/munin/munin-update +## Check for limit excess every 2 minutes +#@ 2 /usr/libexec/munin/munin-limits +## Update graphs every 5 minutes +#@ 5 nice /usr/libexec/munin/munin-graph +## Update HTML pages every 15 minutes +#@ 15 nice /usr/libexec/munin/munin-html +EOF + + # remove .htaccess file + find "${D}" -name .htaccess -delete || die + fi +} + +pkg_config() { + if use minimal; then + einfo "Nothing to do." + return 0 + fi + + einfo "Press enter to install the default crontab for the munin master" + einfo "installation from /usr/share/${PN}/f?crontab" + einfo "If you have a large site, you may wish to customize it." + read + + ebegin "Setting up cron ..." + if has_version sys-process/fcron; then + fcrontab - -u munin < /usr/share/${PN}/fcrontab + else + # dcron is very fussy about syntax + # the following is the only form that works in BOTH dcron and vixie-cron + crontab - -u munin < /usr/share/${PN}/crontab + fi + eend $? + + einfo "Press enter to set up the SSH keys used for SSH transport" + read + + # generate one rsa (for legacy) and one ecdsa (for new systems) + ssh-keygen -t rsa -f /var/lib/munin/.ssh/id_rsa -N '' -C "created by portage for ${CATEGORY}/${PN}" || die + ssh-keygen -t ecdsa -f /var/lib/munin/.ssh/id_ecdsa -N '' -C "created by portage for ${CATEGORY}/${PN}" || die + chown -R munin:munin /var/lib/munin/.ssh || die + chmod 0600 /var/lib/munin/.ssh/id_{rsa,ecdsa} || die + + einfo "Your public keys are available in " + einfo " /var/lib/munin/.ssh/id_rsa.pub" + einfo " /var/lib/munin/.ssh/id_ecdsa.pub" + einfo "and follows for convenience" + echo + cat /var/lib/munin/.ssh/id_*.pub +} + +pkg_postinst() { + elog "Please follow the munin documentation to set up the plugins you" + elog "need, afterwards start munin-node via /etc/init.d/munin-node." + elog "" + elog "To make use of munin-async, make sure to set up the corresponding" + elog "SSH key in /var/lib/munin-async/.ssh/authorized_keys" + elog "" + if ! use minimal; then + elog "Please run" + elog " emerge --config net-analyzer/munin" + elog "to automatically configure munin's cronjobs as well as generate" + elog "passwordless SSH keys to be used with munin-async." + fi + elog "" + elog "Further information about setting up Munin in Gentoo can be found" + elog "in the Gentoo Wiki: https://wiki.gentoo.org/wiki/Munin" + + if use cgi; then + chown $(usex apache apache munin) \ + "${ROOT}"/var/cache/munin-cgi \ + "${ROOT}"/var/log/munin-cgi-{graph,html}.log + + if use apache; then + elog "To use Munin with CGI you should include /etc/apache2/vhosts.d/munin.include" + elog "or /etc/apache2/vhosts.d/munin-2.4.include (for Apache 2.4) from the virtual" + elog "host you want it to be served." + elog "If you want to enable CGI-based HTML as well, you have to add to" + elog "/etc/conf.d/apache2 the option -D MUNIN_HTML_CGI." + else + elog "Effective CGI support has just been added in 2.0.7-r6." + elog "Documentation on how to use it is still sparse." + fi + fi + + # we create this here as we don't want Portage to check /var/run + # symlinks but we still need this to be present before the reboot. + if ! use minimal && ! [[ -d "${ROOT}"/var/run/munin ]]; then + mkdir "${ROOT}"/var/run/munin + chown munin:munin "${ROOT}"/var/run/munin + chmod 0750 "${ROOT}"/var/run/munin + fi +} |