Preserving removed nrpe-3.2.1 ebuilds

This commit is contained in:
Sandino Araico Sanchez 2020-08-22 23:36:22 -05:00
parent 6ec3fb2a90
commit 196f347173
8 changed files with 321 additions and 0 deletions

View file

@ -0,0 +1,8 @@
AUX nrpe-3.2.1-eliminate-systemd-pid.patch 1264 BLAKE2B e0fb75dcc231881fd02fba73de02b983098d7762852d5dea497e717e0c978d773c871d35ba8671a4d292896aa276703ea9d2450e053add1ff3f2d6d9f1c53bf1 SHA512 9e8d58dee6c60b48e209a69eaab10abcc5eccfc28edf073240afba3d3e70a36ead4a568fe6589dd8578d11f0149c968c5977742e9905fa0a407b120c6d168570
AUX nrpe.init 1152 BLAKE2B eea4c8554ef02b7eb9e602a4b0750565520dd830435586043f61534a58563eaed379f1296df5eaf68aab88440f4199354118ffbcc5b4340eda633bb3eb49092c SHA512 19f470407d63b2949535acd6e5849afbea44f82a5773f9110f8b025c380c0626a0a733ead417b1ce293741168acea5a885c2e9f94fb1c0b3e38a06e0eae4ddca
AUX nrpe.service 242 BLAKE2B 715f0e8b91d6c40405d6d1f3689bbbf750e61e78e1d727debbe998ae81922b36f1d5f7c011f6881979e485a81c08d3f1f405b962023fecea643c8f7a9e04c3df SHA512 ffd67467cc4f5ccdf73e0860d1355a8cc3e528d0c67f2054b0ad76c02a43f9c5a8964a3f6df6f91eaa8e15c3c9596259aa964ad69aa2da60678d68fa892b2346
AUX nrpe.xinetd.2 245 BLAKE2B 3e9db31c7d5b28dab18d2f5855d0465f25fc9cf4a70deac9a5d0c87c7cc546a33b432dbca172a49addadc0bd6583d870ec0fe350bf60e015e325d8bb923aca47 SHA512 d687cb2a5babfd28a97d3a5f1ac665758341ecc37fdd0193dbf0df4cba68c88aa24776a33a706989843fa5356b2e3e995662a823ceb2b86ba8f846f8c47e18fb
DIST nrpe-3.2.1.tar.gz 518015 BLAKE2B c9be2bf24e3d9977a7ff5c2f0e08bfe841729289af836bb7ac6ccb2c173a519958b12cc3e90ece612ac6c2527ad472ef1464be648a66b11ff8ad483d5ad78cc1 SHA512 ec6ff42a00bd97ed80010a82e26dc35fd419f2feda65820cda0108068173c1ae44eee698833a50fd2079429a6f5eb1321c4f06b09c6708bc5fbe48f176389856
EBUILD nrpe-3.2.1-r1.ebuild 2519 BLAKE2B 384aa40ebdbf511b6d0f948507dded2dd08bd9583f153a281222b81694f6ebf8fcea30c3c3f8c910bafb56a535c31eb5168240eeffaf265095e591cd63262aa8 SHA512 b0a36fda896c6241e72e8183cd2460e9f234eb7d26d8c7caf06f2cec2674a5b14f372f5346d57fcef60123fd395d7676fe890ad853d7799c6c8009ed484630b9
EBUILD nrpe-3.2.1-r3.ebuild 2823 BLAKE2B 9a84075935704b6293c5bad466daf7dea676206f778cf7ad466929b4e9e593ff0bd7b5eb54c40cf3d1e6f35ef7a9e5da033d4dce7481ce11ec21639d2ce29aba SHA512 b3bc91e7c5a2e5e557aba4e1c891ea6551b4877bdee743ce5264fad84e84258a606a42fb32e085c901b59bc7009ddbd6adbcc703a3886779b3c417c82c708d75
MISC metadata.xml 770 BLAKE2B 93991f7ee4c1b6c26b67e873fae0cdb66170cd93ba6b79d6e798cb2605126888a996f633eccd038ece2a822d1b92498c2036746bb3a1add2e336c6026c2db86d SHA512 48693abab21581eff977b8deaa5fabc5d388960c9cd090b590a1f6d3c8d37b63fe33ec86d6f95d7435404314b84053f8c2ca84b0f33c6c7241ea7260f82a3a27

View file

@ -0,0 +1,38 @@
From c4ad513294e8db25ebaf25127948cce37c13e1b2 Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Sat, 29 Sep 2018 20:23:53 -0400
Subject: [PATCH 1/1] startup/default-service.in: remove PIDFile and
ExecStopPost lines.
The nrpe systemd service is a "simple" service, which means that it
runs in the foreground and doesn't need any PID file tracking to begin
with. The tmpfiles.d entry associated with the PID file is causing
problems in Gentoo bug 648992, and so as a prerequisite for deleting
it, this commit eliminates the PID file.
Bug: https://bugs.gentoo.org/648992
Bug: https://github.com/NagiosEnterprises/nrpe/issues/188
---
startup/default-service.in | 2 --
1 file changed, 2 deletions(-)
diff --git a/startup/default-service.in b/startup/default-service.in
index b6c6063..110a0cd 100644
--- a/startup/default-service.in
+++ b/startup/default-service.in
@@ -11,12 +11,10 @@ WantedBy=multi-user.target
[Service]
Type=simple
Restart=on-abort
-PIDFile=@piddir@/nrpe.pid
RuntimeDirectory=nrpe
RuntimeDirectoryMode=0755
ExecStart=@sbindir@/nrpe -c @pkgsysconfdir@/nrpe.cfg -f
ExecReload=/bin/kill -HUP $MAINPID
-ExecStopPost=/bin/rm -f @piddir@/nrpe.pid
TimeoutStopSec=60
User=@nrpe_user@
Group=@nrpe_group@
--
2.16.4

View file

@ -0,0 +1,49 @@
#!/sbin/openrc-run
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
: ${CFGFILE:=/etc/nagios/nrpe.cfg}
get_config() {
[ -f ${CFGFILE} ] || return 1
sed -n -e 's:^[ \t]*'$1'=\([^#]\+\).*:\1:p' \
${CFGFILE}
}
extra_started_commands="reload"
command=/usr/libexec/${SVCNAME}
command_args="-c ${CFGFILE} --daemon"
pidfile=$(get_config pid_file)
depend() {
config ${CFGFILE}
}
reload() {
ebegin "Reloading ${SVCNAME}"
kill -1 `cat ${pidfile}`
eend $?
}
start()
{
mkdir -p $(dirname $pidfile)
local _background=
ebegin "Starting ${name:-$RC_SVCNAME}"
eval start-stop-daemon --start \
--exec $command \
${procname:+--name} $procname \
${pidfile:+--pidfile} $pidfile \
$_background $start_stop_daemon_args \
-- $command_args
if eend $? "Failed to start $RC_SVCNAME"; then
service_set_value "command" "${command}"
[ -n "${pidfile}" ] && service_set_value "pidfile" "${pidfile}"
[ -n "${procname}" ] && service_set_value "procname" "${procname}"
return 0
fi
return 1
}

View file

@ -0,0 +1,11 @@
[Unit]
Description=Daemon to answer plugin requests from Nagios on remote hosts
After=network.target
Requires=network.target
[Service]
Type=forking
ExecStart=/usr/libexec/nrpe -c /etc/nagios/nrpe.cfg -d
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,11 @@
service nrpe {
socket_type = stream
protocol = tcp
wait = no
user = nagios
group = nagios
server = /usr/libexec/nrpe
server_args = -c /etc/nagios/nrpe.cfg --inetd
# only_from = 127.0.0.1
disabled = yes
}

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>sysadmin@gentoo.org</email>
<name>Gentoo Sysadmin Project</name>
</maintainer>
<longdescription>
A daemon for allowing Nagios to connect directly to servers and
execute commands defined in a centralized configuration file.
</longdescription>
<use>
<flag name="command-args">
Build support for specifying the command-line arguments from the
Nagios/Icinga master. Make sure you understand the implications
of this flag as it can be a security risk.
</flag>
</use>
<upstream>
<remote-id type="sourceforge">nagios</remote-id>
</upstream>
</pkgmetadata>

View file

@ -0,0 +1,89 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit systemd user
DESCRIPTION="Nagios Remote Plugin Executor"
HOMEPAGE="https://github.com/NagiosEnterprises/nrpe"
SRC_URI="https://github.com/NagiosEnterprises/nrpe/releases/download/${P}/${P}.tar.gz"
LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~alpha amd64 ~hppa ppc ppc64 sparc x86"
IUSE="command-args libressl selinux ssl"
DEPEND="sys-apps/tcp-wrappers
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
)"
RDEPEND="${DEPEND}
|| ( net-analyzer/nagios-plugins net-analyzer/monitoring-plugins )
selinux? ( sec-policy/selinux-nagios )"
PATCHES=( "${FILESDIR}/nrpe-3.2.1-eliminate-systemd-pid.patch" )
pkg_setup() {
enewgroup nagios
enewuser nagios -1 /bin/bash /var/nagios/home nagios
}
src_configure() {
# The configure script tries to detect what OS, distribution, and
# init system you're running and changes the build/install process
# depending on what it comes up with. We specify fixed values
# because we don't want it guessing, for example, whether or not
# to install the tmpfiles.d entry based on whether or not systemd
# is currently running (OpenRC uses them too).
econf \
--libexecdir=/usr/$(get_libdir)/nagios/plugins \
--localstatedir=/var/nagios \
--sysconfdir=/etc/nagios \
--with-nrpe-user=nagios \
--with-nrpe-group=nagios \
--with-piddir=/run \
--with-opsys=unknown \
--with-dist-type=unknown \
--with-init-type=unknown \
--with-inetd-type=unknown \
$(use_enable command-args) \
$(use_enable ssl)
}
src_compile() {
emake all
}
src_install() {
default
dodoc CHANGELOG.md SECURITY.md
insinto /etc/nagios
newins sample-config/nrpe.cfg nrpe.cfg
fowners root:nagios /etc/nagios/nrpe.cfg
fperms 0640 /etc/nagios/nrpe.cfg
newinitd "startup/openrc-init" nrpe
newconfd "startup/openrc-conf" nrpe
systemd_newunit "startup/default-service" "${PN}.service"
insinto /etc/xinetd.d/
newins "${FILESDIR}/nrpe.xinetd.2" nrpe
rm "${D}/usr/bin/nrpe-uninstall" || die 'failed to remove uninstall tool'
}
pkg_postinst() {
elog 'Some users have reported incompatibilities between nrpe-2.x and'
elog 'nrpe-3.x. We recommend that you use the same major version for'
elog 'both your server and clients.'
if use command-args ; then
ewarn ''
ewarn 'You have enabled command-args for NRPE. That lets clients'
ewarn 'supply arguments to the commands that are run, and IS A'
ewarn 'SECURITY RISK!'
ewarn''
fi
}

View file

@ -0,0 +1,93 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit systemd
DESCRIPTION="Nagios Remote Plugin Executor"
HOMEPAGE="https://github.com/NagiosEnterprises/nrpe"
SRC_URI="https://github.com/NagiosEnterprises/nrpe/releases/download/${P}/${P}.tar.gz"
LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
IUSE="command-args libressl selinux ssl"
DEPEND="acct-group/nagios
acct-user/nagios
sys-apps/tcp-wrappers
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
)"
RDEPEND="${DEPEND}
|| ( net-analyzer/nagios-plugins net-analyzer/monitoring-plugins )
selinux? ( sec-policy/selinux-nagios )"
PATCHES=( "${FILESDIR}/nrpe-3.2.1-eliminate-systemd-pid.patch" )
src_configure() {
# The configure script tries to detect what OS, distribution, and
# init system you're running and changes the build/install process
# depending on what it comes up with. We specify fixed values
# because we don't want it guessing, for example, whether or not
# to install the tmpfiles.d entry based on whether or not systemd
# is currently running (OpenRC uses them too).
#
# Note: upstream defaults to using "nagios" as the default NRPE
# user and group. I have a feeling that this isn't quite correct
# on a system where "nagios" is also the user running the nagios
# server daemon. In the future, it would be nice if someone who
# actually uses NRPE could test with an unprivileged "nrpe" as
# the user and group.
econf \
--libexecdir=/usr/$(get_libdir)/nagios/plugins \
--localstatedir=/var/lib/nagios \
--sysconfdir=/etc/nagios \
--with-nrpe-user=nagios \
--with-nrpe-group=nagios \
--with-piddir=/run \
--with-opsys=unknown \
--with-dist-type=unknown \
--with-init-type=unknown \
--with-inetd-type=unknown \
$(use_enable command-args) \
$(use_enable ssl)
}
src_compile() {
emake all
}
src_install() {
default
dodoc CHANGELOG.md SECURITY.md
insinto /etc/nagios
newins sample-config/nrpe.cfg nrpe.cfg
fowners root:nagios /etc/nagios/nrpe.cfg
fperms 0640 /etc/nagios/nrpe.cfg
newinitd "startup/openrc-init" nrpe
newconfd "startup/openrc-conf" nrpe
systemd_newunit "startup/default-service" "${PN}.service"
insinto /etc/xinetd.d/
newins "${FILESDIR}/nrpe.xinetd.2" nrpe
rm "${D}/usr/bin/nrpe-uninstall" || die 'failed to remove uninstall tool'
}
pkg_postinst() {
elog 'Some users have reported incompatibilities between nrpe-2.x and'
elog 'nrpe-3.x. We recommend that you use the same major version for'
elog 'both your server and clients.'
if use command-args ; then
ewarn ''
ewarn 'You have enabled command-args for NRPE. That lets clients'
ewarn 'supply arguments to the commands that are run, and IS A'
ewarn 'SECURITY RISK!'
ewarn''
fi
}