1 |
commit: 667c4d4c33593e983947d5a4ce2f59288bd9dc76 |
2 |
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Nov 2 20:42:36 2017 +0000 |
4 |
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 4 23:37:22 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=667c4d4c |
7 |
|
8 |
net-analyzer/pnp4nagios: use consistent perfdata directories. |
9 |
|
10 |
Past revisions have stored the RRDtool data and the process_perdata.pl |
11 |
logs in (for example) /var/nagios or /var/icinga, depending on whether |
12 |
or you had Nagios or Icinga installed. That's silly: the data format |
13 |
doesn't change, so it makes more sense to choose one location (now: |
14 |
/var/lib/pnp) and stick with it. |
15 |
|
16 |
Package-Manager: Portage-2.3.8, Repoman-2.3.3 |
17 |
|
18 |
....6.26-r4.ebuild => pnp4nagios-0.6.26-r5.ebuild} | 32 ++++++++++------------ |
19 |
1 file changed, 15 insertions(+), 17 deletions(-) |
20 |
|
21 |
diff --git a/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r4.ebuild b/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r5.ebuild |
22 |
similarity index 78% |
23 |
rename from net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r4.ebuild |
24 |
rename to net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r5.ebuild |
25 |
index c173abd999e..3e886eb89dc 100644 |
26 |
--- a/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r4.ebuild |
27 |
+++ b/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r5.ebuild |
28 |
@@ -38,27 +38,16 @@ RDEPEND="${DEPEND} |
29 |
PATCHES=( "${FILESDIR}/${PN}-0.6.14-makefile.patch" ) |
30 |
|
31 |
src_configure() { |
32 |
- local var_dir user_group |
33 |
- |
34 |
- if use icinga; then |
35 |
- var_dir=/var/lib/icinga |
36 |
- user_group=icinga |
37 |
- elif use icinga2; then |
38 |
- var_dir=/var/lib/icinga2 |
39 |
- user_group=icinga |
40 |
- else |
41 |
- # Thanks to REQUIRED_USE, "use nagios" is the only other case. |
42 |
- var_dir=/var/nagios |
43 |
- user_group=nagios |
44 |
- fi |
45 |
+ local user_group=nagios |
46 |
+ ( use icinga || use icinga2 ) && user_group=icinga |
47 |
|
48 |
econf \ |
49 |
--sysconfdir="${EPREFIX}"/etc/pnp \ |
50 |
--datarootdir="${EPREFIX}"/usr/share/pnp \ |
51 |
- --with-perfdata-dir="${EPREFIX}"${var_dir}/perfdata \ |
52 |
- --with-nagios-user=${user_group} \ |
53 |
- --with-nagios-group=${user_group} \ |
54 |
- --with-perfdata-logfile="${EPREFIX}"${var_dir}/perfdata.log \ |
55 |
+ --with-nagios-user="${user_group}" \ |
56 |
+ --with-nagios-group="${user_group}" \ |
57 |
+ --with-perfdata-dir="${EPREFIX}"/var/lib/pnp/perfdata \ |
58 |
+ --with-perfdata-logfile="${EPREFIX}"/var/log/pnp/process_perfdata.log \ |
59 |
--with-perfdata-spool-dir="${EPREFIX}"/var/spool/pnp |
60 |
} |
61 |
|
62 |
@@ -88,6 +77,15 @@ src_install() { |
63 |
# server read it. |
64 |
fowners :apache /etc/pnp/process_perfdata.cfg |
65 |
fi |
66 |
+ |
67 |
+ # The nagios or icinga user will also need to be able to write |
68 |
+ # performance data to the perfdata-dir and perfdata-spool-dir |
69 |
+ # directories. |
70 |
+ local user_group=nagios |
71 |
+ ( use icinga || use icinga2 ) && user_group=icinga |
72 |
+ dodir /var/lib/pnp/{,perfdata} /var/log/pnp |
73 |
+ fowners "${user_group}:${user_group}" /var/lib/pnp/{,perfdata} |
74 |
+ fowners "${user_group}:${user_group}" /var/log/pnp |
75 |
} |
76 |
|
77 |
pkg_postinst() { |