From: Michael Orlitzky Date: Fri, 3 Nov 2017 00:21:48 +0000 (-0400) Subject: net-analyzer/pnp4nagios: fix the default stats directory. X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=8f978407a29d863ab28404912b53cdcd37310e06;p=gentoo.git net-analyzer/pnp4nagios: fix the default stats directory. The process_perfdata.cfg file refers to a STATS_DIR that is set to "@localstatedir@/stats" at build-time. However, the build system doesn't create that directory nor ensure that it is writable. This latest revision passes --localstatedir to econf, and then creates the associated directory with the desired permissions. The "bulk mode" without NPCD now works out-of-the-box! Package-Manager: Portage-2.3.8, Repoman-2.3.3 --- diff --git a/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r5.ebuild b/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r6.ebuild similarity index 85% rename from net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r5.ebuild rename to net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r6.ebuild index 3e886eb89dc7..9642d1e64792 100644 --- a/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r5.ebuild +++ b/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r6.ebuild @@ -44,11 +44,10 @@ src_configure() { econf \ --sysconfdir="${EPREFIX}"/etc/pnp \ --datarootdir="${EPREFIX}"/usr/share/pnp \ + --localstatedir="${EPREFIX}"/var/lib/pnp \ --with-nagios-user="${user_group}" \ --with-nagios-group="${user_group}" \ - --with-perfdata-dir="${EPREFIX}"/var/lib/pnp/perfdata \ - --with-perfdata-logfile="${EPREFIX}"/var/log/pnp/process_perfdata.log \ - --with-perfdata-spool-dir="${EPREFIX}"/var/spool/pnp + --with-perfdata-logfile="${EPREFIX}"/var/log/pnp/process_perfdata.log } src_compile() { @@ -78,14 +77,20 @@ src_install() { fowners :apache /etc/pnp/process_perfdata.cfg fi - # The nagios or icinga user will also need to be able to write - # performance data to the perfdata-dir and perfdata-spool-dir - # directories. + # The nagios or icinga user needs to write performance data to the + # perfdata-dir... local user_group=nagios ( use icinga || use icinga2 ) && user_group=icinga - dodir /var/lib/pnp/{,perfdata} /var/log/pnp - fowners "${user_group}:${user_group}" /var/lib/pnp/{,perfdata} + fowners "${user_group}:${user_group}" /var/lib/pnp/{,perfdata,spool} + + # and likewise for its logs... + dodir /var/log/pnp fowners "${user_group}:${user_group}" /var/log/pnp + + # and its statistics. This one is arguably the responsibility of the + # build system, since process_perfdata.cfg refers to this location. + dodir /var/lib/pnp/stats + fowners "${user_group}:${user_group}" /var/lib/pnp/stats } pkg_postinst() {