summaryrefslogtreecommitdiff
path: root/net-analyzer/munin
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
commit3cf7c3ef441822c889356fd1812ebf2944a59851 (patch)
treec513fe68548b40365c1c2ebfe35c58ad431cdd77 /net-analyzer/munin
parent05b8b0e0af1d72e51a3ee61522941bf7605cd01c (diff)
gentoo resync : 25.08.2020
Diffstat (limited to 'net-analyzer/munin')
-rw-r--r--net-analyzer/munin/Manifest5
-rw-r--r--net-analyzer/munin/munin-2.0.59.ebuild2
-rw-r--r--net-analyzer/munin/munin-2.0.64.ebuild417
3 files changed, 422 insertions, 2 deletions
diff --git a/net-analyzer/munin/Manifest b/net-analyzer/munin/Manifest
index 4b5b16bc5fea..37040fcb0d1d 100644
--- a/net-analyzer/munin/Manifest
+++ b/net-analyzer/munin/Manifest
@@ -21,9 +21,12 @@ DIST munin-2.0.61-gentoo-1.tar.xz 3980 BLAKE2B 5aae9c29befa761f797d362c90d810051
DIST munin-2.0.61.tar.gz 2254571 BLAKE2B e73fb6fc4f71c8d56a7e8a05852f699c94a7cf321b8034ad31ccbd06a37a602e6d312c0079fcb31afc5489a265a35a68c037743e01471ca950223d5cb6757b64 SHA512 ea6ae5a7f812985e0179dc2fe2f21136ecf6152ec2adf48d53e4fa19cfc14e74befe56c77a18f27ba966c12034a4fea442d5d1498a7cfe57ed052d332c199019
DIST munin-2.0.63-gentoo-1.tar.xz 3980 BLAKE2B 5aae9c29befa761f797d362c90d810051a7f3a5dc8250776ab6ae1659197d795dfb87274db66ff0a3deb4e10e14ced5b3765551a3f29357c436968a848f450ea SHA512 b21d6590bb9e1da127066a06818f1f3157362762f80526e2231b926956959e62af575f38235f72326376dc21bba63f9767efa379f1f2558ca9b20ddf5395e851
DIST munin-2.0.63.tar.gz 2254548 BLAKE2B 5e0aa63222706a1e23bcb2af98437ee8cc3f09cdf833a6546ea40cf7307728518d5d696bd500105f85139753bc17a26dddfb202a661d35a7046ffc55b5b9ef02 SHA512 c28d2bedda8abb8787e1ba40ec80961d1304c903e9e608e30ed7903210169f258f9c062fc97d89932ddd7aabefa4360495d19535520741911c489c9c3c2e76fe
+DIST munin-2.0.64-gentoo-1.tar.xz 3980 BLAKE2B 5aae9c29befa761f797d362c90d810051a7f3a5dc8250776ab6ae1659197d795dfb87274db66ff0a3deb4e10e14ced5b3765551a3f29357c436968a848f450ea SHA512 b21d6590bb9e1da127066a06818f1f3157362762f80526e2231b926956959e62af575f38235f72326376dc21bba63f9767efa379f1f2558ca9b20ddf5395e851
+DIST munin-2.0.64.tar.gz 2256519 BLAKE2B 6a48327672ab7cf20be7a47d489467d0b888e00c01ca0ce8b0bc47a03b63087cf61de4aaf8ae0f18d8e5ef95c49f85092d719ae7de6fe51bcb5e60d138caa519 SHA512 d5f8fb04a601b053844b04850416f09b9f682b83298e35b973ee495cc60477720dc0483f73809db5ca24ba6b9fa1520f026a3f187db01b0c946cce756e4e401f
EBUILD munin-2.0.52.ebuild 12389 BLAKE2B 4e1046e310948f97ed2469cb58f67c4c7cc6b66ef2fc401a409f2069c2c3b717a1b76d5b9f51add689c00e7daa6a555e927b98f9290ee7e24aac81202f17c557 SHA512 3f1edf0c2c9a35f17794003e143fbde255f60527e0f595a40233b63c1cfaf3bb00416902f6f45941c597987eb292d6b507cc8eb3720d2a17793607f9099ed823
EBUILD munin-2.0.56.ebuild 12254 BLAKE2B 925fe7a93c3130d665afa4aa9c874bbf34b22e29fea84fbb6a5f518facd256cb79bf1e2b20ffa5f086d1a8715328a3f34482e1e08f7ded2fa924a976b20cd93f SHA512 5fdc2357b5a48815f7de08d46def379bc5d263b68f1f88ecd5756d095299a53fc8996dce41350fd4281bba434c85c090bfbd965edc1ca46ce5f051d47eeb7c46
-EBUILD munin-2.0.59.ebuild 12268 BLAKE2B e78aa776ec73f1c59d92ef59b52f974fb902d03935e2022e08899cd94d7a042f73599e789cd20ee31f9e9672a8814681257057a79e9fb274b5c415bed8280ebf SHA512 1b675ac0ec7b689a38236c87a726fe147c06086fc0f378d04e4d88a6baec7b14239d72024ffb69060d972f92ae42156ea60dbb008d878de3921fb8b9ceaf0ed4
+EBUILD munin-2.0.59.ebuild 12267 BLAKE2B d4fb2b1f62a4c1a3d1d69fa61e841c17ad6716fa824df49352ad2e5c5ddc39a035c828830302cd6414750c72e2b52198a76efd936d2300dd76529dc2994054ce SHA512 c306d35fe98c0dd9668068fcad1830cf1c5fd45839187b0a91cde40f075a7a042a737e4cc53cdbb27da5049f52021a63cb925040f5b2e54f91155811f7413252
EBUILD munin-2.0.61.ebuild 12270 BLAKE2B 88ca95c980e9e487b32fe6050cb62fb651efa1b576db5a94d6bd1b5a5ffb53a59b9c2dc0f13b483de4529487622e488efe67fc60b4deef22fdf1f047d5c49194 SHA512 f8c17a89d5e1d26b68bbd9ee5bb50fa5b150341044c38baa6e7e875512b66c59981df7ec701feb12880d0339f304e396e84548dc2b7518d1ee51a844a101f8c4
EBUILD munin-2.0.63.ebuild 12270 BLAKE2B 88ca95c980e9e487b32fe6050cb62fb651efa1b576db5a94d6bd1b5a5ffb53a59b9c2dc0f13b483de4529487622e488efe67fc60b4deef22fdf1f047d5c49194 SHA512 f8c17a89d5e1d26b68bbd9ee5bb50fa5b150341044c38baa6e7e875512b66c59981df7ec701feb12880d0339f304e396e84548dc2b7518d1ee51a844a101f8c4
+EBUILD munin-2.0.64.ebuild 12270 BLAKE2B 88ca95c980e9e487b32fe6050cb62fb651efa1b576db5a94d6bd1b5a5ffb53a59b9c2dc0f13b483de4529487622e488efe67fc60b4deef22fdf1f047d5c49194 SHA512 f8c17a89d5e1d26b68bbd9ee5bb50fa5b150341044c38baa6e7e875512b66c59981df7ec701feb12880d0339f304e396e84548dc2b7518d1ee51a844a101f8c4
MISC metadata.xml 3920 BLAKE2B cb28e1a3e95ffcc305975d7edc26a5cf852a2a29f8c56376c9bbc90fd2b2850bfeb614d750e7700870aa0c10c8dcfcd2b845c210a5518f591ccfbb7571971cda SHA512 9d12c61750f5ee42cfcb6672facf3b46a024872d918c7acb26631c1b9bab29802a6ac9f4d895b9f4ef18a6f283ad64d4bd6e313df0489a6ed82185c660c42083
diff --git a/net-analyzer/munin/munin-2.0.59.ebuild b/net-analyzer/munin/munin-2.0.59.ebuild
index 5fe4c097bffd..5e64da737295 100644
--- a/net-analyzer/munin/munin-2.0.59.ebuild
+++ b/net-analyzer/munin/munin-2.0.59.ebuild
@@ -17,7 +17,7 @@ SRC_URI="
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ppc ~ppc64 x86"
+KEYWORDS="amd64 ~arm ~arm64 ppc ~ppc64 x86"
IUSE="asterisk irc java ldap memcached minimal mysql postgres selinux ssl test cgi ipv6 syslog ipmi http dhcpd doc apache2"
REQUIRED_USE="cgi? ( !minimal ) apache2? ( cgi )"
RESTRICT="!test? ( test )"
diff --git a/net-analyzer/munin/munin-2.0.64.ebuild b/net-analyzer/munin/munin-2.0.64.ebuild
new file mode 100644
index 000000000000..acaf9f6d9f0c
--- /dev/null
+++ b/net-analyzer/munin/munin-2.0.64.ebuild
@@ -0,0 +1,417 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PATCHSET=1
+
+inherit java-pkg-opt-2 systemd
+
+MY_P=${P/_/-}
+
+DESCRIPTION="Munin Server Monitoring Tool"
+HOMEPAGE="http://munin-monitoring.org/"
+SRC_URI="
+ https://github.com/munin-monitoring/munin/archive/${PV}.tar.gz -> ${P}.tar.gz
+ https://dev.gentoo.org/~graaff/munin/${P}-gentoo-${PATCHSET}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
+IUSE="asterisk irc java ldap memcached minimal mysql postgres selinux ssl test cgi ipv6 syslog ipmi http dhcpd doc apache2"
+REQUIRED_USE="cgi? ( !minimal ) apache2? ( cgi )"
+RESTRICT="!test? ( test )"
+
+# 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="
+ acct-user/munin
+ acct-user/munin-async
+ acct-group/munin
+ dev-lang/perl:=[berkdb]
+ dev-perl/DBI
+ dev-perl/Date-Manip
+ dev-perl/File-Copy-Recursive
+ dev-perl/List-MoreUtils
+ dev-perl/Log-Log4perl
+ dev-perl/Net-CIDR
+ dev-perl/Net-DNS
+ 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
+ apache2? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] )
+ asterisk? ( dev-perl/Net-Telnet )
+ cgi? (
+ dev-perl/FCGI
+ dev-perl/CGI-Fast
+ )
+ dhcpd? (
+ >=net-misc/dhcp-3[server]
+ dev-perl/Net-IP
+ dev-perl/HTTP-Date
+ )
+ doc? ( dev-python/sphinx )
+ http? ( dev-perl/libwww-perl )
+ irc? ( dev-perl/Net-IRC )
+ ldap? ( dev-perl/perl-ldap )
+ kernel_linux? ( sys-process/procps )
+ memcached? ( dev-perl/Cache-Memcached )
+ mysql? (
+ virtual/mysql
+ dev-perl/Cache-Cache
+ dev-perl/DBD-mysql
+ )
+ postgres? ( dev-perl/DBD-Pg dev-db/postgresql:* )
+ ssl? ( dev-perl/Net-SSLeay )
+ syslog? ( virtual/perl-Sys-Syslog )
+ !minimal? (
+ dev-perl/HTML-Template
+ dev-perl/IO-Socket-INET6
+ dev-perl/URI
+ >=net-analyzer/rrdtool-1.3[graph,perl]
+ virtual/ssh
+ )
+ "
+
+# Keep this seperate, as previous versions have had other deps here
+DEPEND="${DEPEND_COM}
+ dev-perl/Module-Build
+ java? ( >=virtual/jdk-1.5 )
+ test? (
+ dev-perl/Test-Deep
+ dev-perl/Test-Exception
+ 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/netcat net-analyzer/openbsd-netcat )
+ )
+ !minimal? (
+ virtual/cron
+ media-fonts/dejavu
+ )
+ selinux? ( sec-policy/selinux-munin )"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ echo ${PV} > RELEASE || die
+
+ eapply "${WORKDIR}"/patches/*.patch
+
+ eapply_user
+
+ 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 apache2 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
+ PERLLIB=\$(DESTDIR)$(perl -V:vendorlib | cut -d"'" -f2)
+ JCVALID=$(usex java yes no)
+ STATEDIR=\$(DESTDIR)/run/munin
+ EOF
+}
+
+# parallel make and install need to be fixed before, and I haven't
+# gotten around to do so yet.
+src_compile() {
+ emake -j1
+ use doc && emake -C doc html
+}
+
+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
+ /var/lib/munin-node/plugin-state
+ /var/www/localhost/htdocs/munin
+ /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 CHOWN=true DESTDIR="${D}" $(usex minimal "install-minimal install-man" install)
+
+ # we remove /run from the install, as it's not the package's to deal
+ # with.
+ rm -rf "${D}"/run || die
+
+ # remove the plugins for non-Gentoo package managers; use -f so that
+ # it doesn't fail when installing on non-Linux platforms.
+ rm -f "${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.19 munin-node
+ newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node
+
+ newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd
+
+ dodir /usr/lib/tmpfiles.d
+ cat > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<- EOF
+ d /run/munin 0700 munin munin - -
+ EOF
+
+ systemd_dounit "${FILESDIR}"/munin-async.service
+ systemd_dounit "${FILESDIR}"/munin-graph.{service,socket}
+ systemd_dounit "${FILESDIR}"/munin-html.{service,socket}
+ systemd_dounit "${FILESDIR}"/munin-node.service
+
+ 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 || die
+ docinto html
+ dodoc -r *
+ cd "${S}" || die
+ fi
+
+ dodir /etc/logrotate.d/
+ sed -e "s:@CGIUSER@:$(usex apache2 apache munin):g" \
+ "${FILESDIR}"/logrotate.d-munin.3 > "${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:/run/munin/munin-node.pid:/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
+ # 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 apache2 apache munin) \
+ /var/cache/munin-cgi \
+ /var/log/munin/munin-cgi-{graph,html}.log
+
+ if use apache2; 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 \
+ -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' \
+ -i "${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."
+ 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 apache2 apache munin) \
+ "${ROOT}"/var/cache/munin-cgi \
+ "${ROOT}"/var/log/munin/munin-cgi-{graph,html}.log
+
+ if use apache2; 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 /run
+ # symlinks but we still need this to be present before the reboot.
+ if ! use minimal && ! [[ -d "${ROOT}"/run/munin ]]; then
+ mkdir "${ROOT}"/run/munin
+ chown munin:munin "${ROOT}"/run/munin
+ chmod 0700 "${ROOT}"/run/munin
+ fi
+}