From fa618ad4282bbbbd35ee53dcd71fed599fec9e68 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 18:21:12 +0200 Subject: Adding upstream version 4.1.0. Signed-off-by: Daniel Baumann --- startup/gentoo-init.in | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 startup/gentoo-init.in (limited to 'startup/gentoo-init.in') diff --git a/startup/gentoo-init.in b/startup/gentoo-init.in new file mode 100644 index 0000000..c7adc55 --- /dev/null +++ b/startup/gentoo-init.in @@ -0,0 +1,49 @@ +#!/sbin/openrc-run +# +# Copyright (c) 2016 Nagios(R) Core(TM) Development Team +# +# Start/stop the nrpe daemon. +# +# Goes in /etc/init.d - Config is in /etc/conf.d/nrpe + +extra_started_commands="reload" + +NRPE_BIN="@sbindir@/nrpe" +NRPE_PID="@piddir@/nrpe.pid" +NRPE_CFG=@pkgsysconfdir@/nrpe.cfg + +depend() { + use logger dns net localmount netmount nfsmount +} + +checkconfig() { + # Make sure the config file exists + if [ ! -f $NRPE_CFG ]; then + eerror "You need to setup $NRPE_CFG." + return 1 + fi + return 0 +} + +start() { + checkconfig || return 1 + ebegin "Starting nrpe" + # Make sure we have a sane current directory + cd / + start-stop-daemon --start --exec $NRPE_BIN --pidfile $NRPE_PID \ + --background -- -c $NRPE_CFG -f $NRPE_OPTS + eend $? +} + +stop() { + ebegin "Stopping nrpe" + start-stop-daemon --stop --exec $NRPE_BIN --pidfile $NRPE_PID + eend $? +} + +reload() { + ebegin "Reloading nrpe" + start-stop-daemon --stop --oknodo --exec $NRPE_BIN \ + --pidfile $NRPE_PID --signal HUP + eend $? +} -- cgit v1.2.3