net-analyzer/pnp4nagios: fix the default stats directory.
authorMichael Orlitzky <mjo@gentoo.org>
Fri, 3 Nov 2017 00:21:48 +0000 (20:21 -0400)
committerMichael Orlitzky <mjo@gentoo.org>
Sat, 4 Nov 2017 23:37:22 +0000 (19:37 -0400)
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

net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r6.ebuild [moved from net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r5.ebuild with 85% similarity]

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 3e886eb89dc70a18b00f4befac012bc9ddf627a3..9642d1e64792792c40e55f19650bc5d1ae018719 100644 (file)
@@ -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() {