summaryrefslogtreecommitdiffstats
path: root/startup/gentoo-init.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:20:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:20:09 +0000
commit018433a6da60c6395baaaa0833d5c50ac6645552 (patch)
tree2012deeff2f98b267c0c10425c1d4a054190b73f /startup/gentoo-init.in
parentInitial commit. (diff)
downloadnagios-nrpe-018433a6da60c6395baaaa0833d5c50ac6645552.tar.xz
nagios-nrpe-018433a6da60c6395baaaa0833d5c50ac6645552.zip
Adding upstream version 3.2.1.upstream/3.2.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--startup/gentoo-init.in49
1 files changed, 49 insertions, 0 deletions
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 $?
+}