Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/nagios-core/files/, net-analyzer/nagios-core/
Date: Sat, 31 Aug 2019 21:35:43
Message-Id: 1567287294.390a02aa9cab0a7bdf5a86b0abc48f842d5b5ed3.mjo@gentoo
1 commit: 390a02aa9cab0a7bdf5a86b0abc48f842d5b5ed3
2 Author: Tomas Mozes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Fri Aug 30 07:19:45 2019 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 31 21:34:54 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=390a02aa
7
8 net-analyzer/nagios-core: drop old
9
10 Package-Manager: Portage-2.3.71, Repoman-2.3.17
11 Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com>
12 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
13
14 net-analyzer/nagios-core/Manifest | 1 -
15 .../nagios-core-4.4.4-no-zombie-processes.patch | 158 ---------------
16 .../nagios-core/nagios-core-4.4.4-r1.ebuild | 215 ---------------------
17 3 files changed, 374 deletions(-)
18
19 diff --git a/net-analyzer/nagios-core/Manifest b/net-analyzer/nagios-core/Manifest
20 index 87e9dd98c4f..c1cd0864f89 100644
21 --- a/net-analyzer/nagios-core/Manifest
22 +++ b/net-analyzer/nagios-core/Manifest
23 @@ -1,4 +1,3 @@
24 DIST nagios-4.3.4.tar.gz 11101966 BLAKE2B 6cb8182f40a4f83875c94df040bb1c62ce078d4130e10fa8595ea0b14cf715fc2a237ffb34199da9c1528e4789f3ce8deae3d993b5b795ad712d48b1e5fdb820 SHA512 f4e92aa98151739442a225a245871d93b5560d89510bdacb1a615959b9687f7a92675f10fcba71078b104ca8f237b0155a9261d67ec66f80aec7f033b4b3e316
25 -DIST nagios-4.4.4.tar.gz 11303598 BLAKE2B e4015ca5c0383b0540f2eaf3d608343df850c6045a4539c1f1ab8c19dc95e9223816efe71034b37f6995cb623dc6b83c92e22a677fe687a34d2215b1a2758c90 SHA512 c8f2b83bad744d67be4ba8356d9eea0be3efbf42d9a215d64815cdf7d944eba798348ce0faea6cebe64f1c99e0edbf12540d83ca42f8b4b563cbcc60139afdb0
26 DIST nagios-4.4.5.tar.gz 11304463 BLAKE2B e1152c2cd14aa790fbdb84c0d7b3eb4691b05793640bf2871bc4ab1e2d645bb52bb2d1660b7389fb26d599d015f71820988ed1cd58003ed978dd9df38c357675 SHA512 14372e2e4470229bd000a8ad94def6ae504ce3f8e2cf94a9da73736560d1e3b2633302fe232ee7099d88ba00aecde5a9e352901828d6d9a9cd1fdce203deca30
27 DIST nagios-core-gentoo-icons-20141125.tar 40960 BLAKE2B 31c1953e1160c7c7b89606b72b1a80407e4c1b7a7938b40bd1c577cd0c309dd88ca6b775d692a9b846dbf67736537fa9c91e56aa15fdd447769608ca525bff09 SHA512 bf109879cddd6136b76baba55d0b60b2596e37431dcf5ce0905d34a9fa292ebf7e4bde82d9a084362c486e8fac344c76d88f9298b1b85541ed70ffd608493766
28
29 diff --git a/net-analyzer/nagios-core/files/nagios-core-4.4.4-no-zombie-processes.patch b/net-analyzer/nagios-core/files/nagios-core-4.4.4-no-zombie-processes.patch
30 deleted file mode 100644
31 index 4592b1d27f4..00000000000
32 --- a/net-analyzer/nagios-core/files/nagios-core-4.4.4-no-zombie-processes.patch
33 +++ /dev/null
34 @@ -1,158 +0,0 @@
35 -This was an upstream bug that has been reverted for nagios-core-4.4.5:
36 -
37 - https://github.com/NagiosEnterprises/nagioscore/issues/683
38 -
39 -Thanks to Tomáš Mózes (hydrapolic) for noticing and reporting the fix.
40 -
41 -diff --git a/base/events.c b/base/events.c
42 -index d601e970f..bb27b3240 100644
43 ---- a/base/events.c
44 -+++ b/base/events.c
45 -@@ -351,13 +351,12 @@ void init_timing_loop(void) {
46 - */
47 - check_delay =
48 - mult_factor * scheduling_info.service_inter_check_delay;
49 -- time_t check_window = reschedule_within_timeperiod(next_valid_time, temp_service->check_period_ptr, check_window(temp_service)) - current_time;
50 -- if(check_delay > check_window) {
51 -+ if(check_delay > check_window(temp_service)) {
52 - log_debug_info(DEBUGL_EVENTS, 0,
53 - " Fixing check time %lu secs too far away\n",
54 -- check_delay - check_window);
55 -+ check_delay - check_window(temp_service));
56 - fixed_services++;
57 -- check_delay = check_window;
58 -+ check_delay = check_window(temp_service);
59 - log_debug_info(DEBUGL_EVENTS, 0, " New check offset: %d\n",
60 - check_delay);
61 - }
62 -@@ -370,7 +369,8 @@ void init_timing_loop(void) {
63 - if(is_valid_time == ERROR) {
64 - log_debug_info(DEBUGL_EVENTS, 2, "Preferred Time is Invalid In Timeperiod '%s': %lu --> %s\n", temp_service->check_period_ptr->name, (unsigned long)temp_service->next_check, ctime(&temp_service->next_check));
65 - get_next_valid_time(temp_service->next_check, &next_valid_time, temp_service->check_period_ptr);
66 -- temp_service->next_check = reschedule_within_timeperiod(next_valid_time, temp_service->check_period_ptr, check_window(temp_service));
67 -+ temp_service->next_check =
68 -+ (time_t)(next_valid_time + check_delay);
69 - }
70 -
71 - log_debug_info(DEBUGL_EVENTS, 2, "Actual Check Time: %lu --> %s\n", (unsigned long)temp_service->next_check, ctime(&temp_service->next_check));
72 -@@ -508,7 +508,7 @@ void init_timing_loop(void) {
73 - log_debug_info(DEBUGL_EVENTS, 1, "Fixing check time (off by %lu)\n",
74 - check_delay - check_window(temp_host));
75 - fixed_hosts++;
76 -- check_delay = reschedule_within_timeperiod(next_valid_time, temp_host->check_period_ptr, check_window(temp_host));
77 -+ check_delay = ranged_urand(0, check_window(temp_host));
78 - }
79 - temp_host->next_check = (time_t)(current_time + check_delay);
80 -
81 -diff --git a/cgi/status.c b/cgi/status.c
82 -index ae723c683..2f6a60fde 100644
83 ---- a/cgi/status.c
84 -+++ b/cgi/status.c
85 -@@ -221,8 +221,26 @@ int main(void) {
86 - document_header(TRUE);
87 -
88 - /* if a navbar search was performed, find the host by name, address or partial name */
89 -- if(navbar_search == TRUE) {
90 -- if(host_name != NULL && NULL != strstr(host_name, "*")) {
91 -+ if(navbar_search == TRUE && host_name != NULL) {
92 -+
93 -+ /* Remove trailing spaces from host_name */
94 -+ len = strlen(host_name);
95 -+ for (i = len - 1; i >= 0; i--) {
96 -+ if (!isspace(host_name[i])) {
97 -+ host_name[i+1] = '\0';
98 -+ break;
99 -+ }
100 -+ }
101 -+
102 -+ /* Remove leading spaces from host_name */
103 -+ for (i = 0; i < len; i++) {
104 -+ if (!isspace(host_name[i])) {
105 -+ break;
106 -+ }
107 -+ }
108 -+ strcpy(host_name, host_name + i);
109 -+
110 -+ if(NULL != strstr(host_name, "*")) {
111 - /* allocate for 3 extra chars, ^, $ and \0 */
112 - host_filter = malloc(sizeof(char) * (strlen(host_name) * 2 + 3));
113 - len = strlen(host_name);
114 -@@ -238,7 +256,7 @@ int main(void) {
115 - host_filter[regex_i++] = '$';
116 - host_filter[regex_i] = '\0';
117 - }
118 -- else if (host_name != NULL) {
119 -+ else {
120 - if((temp_host = find_host(host_name)) == NULL) {
121 - for(temp_host = host_list; temp_host != NULL; temp_host = temp_host->next) {
122 - if(is_authorized_for_host(temp_host, &current_authdata) == FALSE)
123 -diff --git a/lib/worker.c b/lib/worker.c
124 -index 4f7cbc384..a94719cc4 100644
125 ---- a/lib/worker.c
126 -+++ b/lib/worker.c
127 -@@ -215,7 +215,7 @@ int worker_buf2kvvec_prealloc(struct kvvec *kvv, char *buf, unsigned long len, i
128 - } while (0)
129 -
130 - /* forward declaration */
131 --static int gather_output(child_process *cp, iobuf *io, int final);
132 -+static void gather_output(child_process *cp, iobuf *io, int final);
133 -
134 - static void destroy_job(child_process *cp)
135 - {
136 -@@ -258,23 +258,15 @@ static void destroy_job(child_process *cp)
137 - int finish_job(child_process *cp, int reason)
138 - {
139 - static struct kvvec resp = KVVEC_INITIALIZER;
140 -- int i, ret, rd;
141 -+ int i, ret;
142 -
143 - /* get rid of still open filedescriptors */
144 - if (cp->outstd.fd != -1) {
145 --
146 -- rd = 1;
147 -- while(rd > 0) {
148 -- rd = gather_output(cp, &cp->outstd, 0);
149 -- }
150 -+ gather_output(cp, &cp->outstd, 1);
151 - iobroker_close(iobs, cp->outstd.fd);
152 - }
153 - if (cp->outerr.fd != -1) {
154 --
155 -- rd = 1;
156 -- while(rd > 0) {
157 -- rd = gather_output(cp, &cp->outerr, 0);
158 -- }
159 -+ gather_output(cp, &cp->outerr, 1);
160 - iobroker_close(iobs, cp->outerr.fd);
161 - }
162 -
163 -@@ -450,13 +442,13 @@ static void kill_job(child_process *cp, int reason)
164 - destroy_job(cp);
165 - }
166 -
167 --static int gather_output(child_process *cp, iobuf *io, int final)
168 -+static void gather_output(child_process *cp, iobuf *io, int final)
169 - {
170 - int retry = 5;
171 -- int rd;
172 -
173 - for (;;) {
174 - char buf[4096];
175 -+ int rd;
176 -
177 - rd = read(io->fd, buf, sizeof(buf));
178 - if (rd < 0) {
179 -@@ -492,13 +484,13 @@ static int gather_output(child_process *cp, iobuf *io, int final)
180 - if (rd <= 0 || final) {
181 - iobroker_close(iobs, io->fd);
182 - io->fd = -1;
183 -+ if (!final)
184 -+ check_completion(cp, WNOHANG);
185 - break;
186 - }
187 -
188 - break;
189 - }
190 --
191 -- return rd;
192 - }
193
194 diff --git a/net-analyzer/nagios-core/nagios-core-4.4.4-r1.ebuild b/net-analyzer/nagios-core/nagios-core-4.4.4-r1.ebuild
195 deleted file mode 100644
196 index 520b2503a8c..00000000000
197 --- a/net-analyzer/nagios-core/nagios-core-4.4.4-r1.ebuild
198 +++ /dev/null
199 @@ -1,215 +0,0 @@
200 -# Copyright 1999-2019 Gentoo Authors
201 -# Distributed under the terms of the GNU General Public License v2
202 -
203 -EAPI=6
204 -
205 -inherit toolchain-funcs user
206 -
207 -MY_P=${PN/-core}-${PV}
208 -DESCRIPTION="Nagios core - monitoring daemon, web GUI, and documentation"
209 -HOMEPAGE="https://www.nagios.org/"
210 -
211 -# The name of the directory into which our Gentoo icons will be
212 -# extracted, and also the basename of the archive containing it.
213 -GENTOO_ICONS="${PN}-gentoo-icons-20141125"
214 -SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz
215 - web? ( https://dev.gentoo.org/~mjo/distfiles/${GENTOO_ICONS}.tar )"
216 -
217 -LICENSE="GPL-2"
218 -SLOT="0"
219 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86"
220 -IUSE="apache2 classicui lighttpd perl +web vim-syntax"
221 -
222 -# In pkg_postinst(), we change the group of the Nagios configuration
223 -# directory to that of the web server user. It can't belong to both
224 -# apache/lighttpd groups at the same time, so we block this combination
225 -# for our own sanity.
226 -#
227 -# This could be made to work, but we would need a better way to allow
228 -# the web user read-only access to Nagios's configuration directory.
229 -#
230 -REQUIRED_USE="apache2? ( !lighttpd )"
231 -
232 -#
233 -# Note, we require one of the apache2 CGI modules:
234 -#
235 -# * mod_cgi
236 -# * mod_cgid
237 -# * mod_fcgid
238 -#
239 -# We just don't care /which/ one. And of course PHP supports both CGI
240 -# (USE=cgi) and FastCGI (USE=fpm). We're pretty lenient with the
241 -# dependencies, and expect the user not to do anything /too/
242 -# stupid. (For example, installing Apache with only FastCGI support, and
243 -# PHP with only CGI support.)
244 -#
245 -# Another annoyance is that the upstream Makefile uses app-arch/unzip to
246 -# extract a snapshot of AngularJS, but that's only needed when USE=web.
247 -#
248 -MOD_ALIAS=apache2_modules_alias
249 -DEPEND="dev-libs/libltdl:0
250 - virtual/mailx
251 - perl? ( dev-lang/perl:= )
252 - web? (
253 - app-arch/unzip
254 - media-libs/gd[jpeg,png]
255 - lighttpd? ( www-servers/lighttpd[php] )
256 - apache2? (
257 - || (
258 - >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_cgi]
259 - >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_cgid]
260 - >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_fcgid] )
261 - || (
262 - dev-lang/php:*[apache2]
263 - dev-lang/php:*[cgi]
264 - dev-lang/php:*[fpm] )
265 - )
266 - )"
267 -RDEPEND="${DEPEND}
268 - vim-syntax? ( app-vim/nagios-syntax )"
269 -
270 -S="${WORKDIR}/${MY_P}"
271 -
272 -PATCHES=( "${FILESDIR}/${P}-no-zombie-processes.patch" )
273 -
274 -pkg_setup() {
275 - enewgroup nagios
276 - enewuser nagios -1 /bin/bash /var/nagios/home nagios
277 -}
278 -
279 -src_configure() {
280 - local myconf
281 -
282 - if use perl; then
283 - myconf="${myconf} --enable-embedded-perl --with-perlcache"
284 - fi
285 -
286 - if use !apache2 && use !lighttpd ; then
287 - myconf="${myconf} --with-command-group=nagios"
288 - else
289 - if use apache2 ; then
290 - myconf="${myconf} --with-command-group=apache"
291 - myconf="${myconf} --with-httpd-conf=/etc/apache2/conf.d"
292 - elif use lighttpd ; then
293 - myconf="${myconf} --with-command-group=lighttpd"
294 - fi
295 - fi
296 -
297 - econf ${myconf} \
298 - --prefix=/usr \
299 - --bindir=/usr/sbin \
300 - --localstatedir=/var/nagios \
301 - --sysconfdir=/etc/nagios \
302 - --libexecdir=/usr/$(get_libdir)/nagios/plugins \
303 - --with-cgibindir=/usr/$(get_libdir)/nagios/cgi-bin \
304 - --with-webdir=/usr/share/nagios/htdocs
305 -}
306 -
307 -src_compile() {
308 - emake CC=$(tc-getCC) nagios
309 -
310 - if use web; then
311 - # Only compile the CGIs/HTML when USE=web is set.
312 - emake CC=$(tc-getCC) DESTDIR="${D}" cgis html
313 - fi
314 -}
315 -
316 -src_install() {
317 - dodoc Changelog CONTRIBUTING.md README.md THANKS UPGRADING
318 -
319 - # There is no way to install the CGIs unstripped from the top-level
320 - # makefile, so descend into base/ here. The empty INSTALL_OPTS
321 - # ensures that root:root: owns the nagios executables.
322 - cd "${S}/base" || die
323 - emake INSTALL_OPTS="" DESTDIR="${D}" install-unstripped
324 - cd "${S}" || die
325 -
326 - # Otherwise this gets installed as 770 and you get "access denied"
327 - # for some reason or other when starting nagios. The permissions
328 - # on nagiostats are just for consistency (these should both get
329 - # fixed upstream).
330 - fperms 775 /usr/sbin/nagios /usr/sbin/nagiostats
331 -
332 - # INSTALL_OPTS are needed for most of install-basic, but we don't
333 - # want them on the LIBEXECDIR, argh.
334 - emake DESTDIR="${D}" install-basic
335 - fowners root:root /usr/$(get_libdir)/nagios/plugins
336 -
337 - # Don't make the configuration owned by the nagios user, because
338 - # then he can edit nagios.cfg and trick nagios into running as root
339 - # and doing his bidding.
340 - emake INSTALL_OPTS="" DESTDIR="${D}" install-config
341 -
342 - # No INSTALL_OPTS used in install-commandmode, thankfully.
343 - emake DESTDIR="${D}" install-commandmode
344 -
345 - if use web; then
346 - # There is no way to install the CGIs unstripped from the
347 - # top-level makefile, so descend into cgi/ here. The empty
348 - # INSTALL_OPTS ensures that root:root: owns the CGI executables.
349 - cd "${S}/cgi" || die
350 - emake INSTALL_OPTS="" DESTDIR="${D}" install-unstripped
351 - cd "${S}" || die
352 -
353 - # install-html installs the new exfoliation theme
354 - emake INSTALL_OPTS="" DESTDIR="${D}" install-html
355 -
356 - if use classicui; then
357 - # This overwrites the already-installed exfoliation theme
358 - emake INSTALL_OPTS="" DESTDIR="${D}" install-classicui
359 - fi
360 -
361 - # Install cute Gentoo icons (bug #388323), setting their
362 - # owner, group, and mode to match those of the rest of Nagios's
363 - # images.
364 - insinto /usr/share/nagios/htdocs/images/logos
365 - doins "${WORKDIR}/${GENTOO_ICONS}"/*.*
366 - fi
367 -
368 - newinitd startup/openrc-init nagios
369 -
370 - if use web ; then
371 - if use apache2 ; then
372 - # Install the Nagios configuration file for Apache.
373 - insinto "/etc/apache2/modules.d"
374 - doins "${FILESDIR}"/99_nagios4.conf
375 - elif use lighttpd ; then
376 - # Install the Nagios configuration file for Lighttpd.
377 - insinto /etc/lighttpd
378 - newins "${FILESDIR}/lighttpd_nagios4.conf" nagios.conf
379 - else
380 - ewarn "${CATEGORY}/${PF} only supports apache or lighttpd"
381 - ewarn "out of the box. Since you are not using one of them, you"
382 - ewarn "will have to configure your webserver yourself."
383 - fi
384 - fi
385 -}
386 -
387 -pkg_postinst() {
388 -
389 - if use web; then
390 - if use apache2 || use lighttpd ; then
391 - if use apache2; then
392 - elog "To enable the Nagios web front-end, please edit"
393 - elog "${ROOT}etc/conf.d/apache2 and add \"-D NAGIOS -D PHP\""
394 - elog "to APACHE2_OPTS. Then Nagios will be available at,"
395 - elog
396 - elif use lighttpd; then
397 - elog "To enable the Nagios web front-end, please add"
398 - elog "'include \"nagios.conf\"' to the lighttpd configuration"
399 - elog "file at ${ROOT}etc/lighttpd/lighttpd.conf. Then Nagios"
400 - elog "will be available at,"
401 - elog
402 - fi
403 -
404 - elog " http://localhost/nagios/"
405 - fi
406 - fi
407 -
408 - elog
409 - elog "If your kernel has /proc protection, nagios"
410 - elog "will not be happy as it relies on accessing the proc"
411 - elog "filesystem. You can fix this by adding nagios into"
412 - elog "the group wheel, but this is not recomended."
413 - elog
414 -}