summaryrefslogtreecommitdiffstats
path: root/startup/newbsd-init.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:21:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:21:12 +0000
commitfa618ad4282bbbbd35ee53dcd71fed599fec9e68 (patch)
tree9dfd8920b74d0bdcfdd3f663fcc8e74701cf095b /startup/newbsd-init.in
parentInitial commit. (diff)
downloadnagios-nrpe-fa618ad4282bbbbd35ee53dcd71fed599fec9e68.tar.xz
nagios-nrpe-fa618ad4282bbbbd35ee53dcd71fed599fec9e68.zip
Adding upstream version 4.1.0.upstream/4.1.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'startup/newbsd-init.in')
-rw-r--r--startup/newbsd-init.in35
1 files changed, 35 insertions, 0 deletions
diff --git a/startup/newbsd-init.in b/startup/newbsd-init.in
new file mode 100644
index 0000000..aa4ed45
--- /dev/null
+++ b/startup/newbsd-init.in
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# Copyright (c) 2016 Nagios(R) Core(TM) Development Team
+#
+# PROVIDE: nrpe
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+: ${nrpe@bsd_enable@:="NO"}
+: ${nrpe_configfile:="@pkgsysconfdir@/nrpe.cfg"}
+
+name=nrpe
+command="@sbindir@/nrpe"
+command_args="-c $nrpe_configfile -d"
+pidfile="@piddir@/nrpe.pid"
+extra_commands=reload
+sig_reload=HUP
+rcvar=nrpe@bsd_enable@
+load_rc_config "$name"
+required_files="$nrpe_configfile"
+sig_reload=HUP
+
+start_precmd=nrpe_prestart
+
+nrpe_prestart()
+{
+ [ -n "$nrpe_pidfile" ] &&
+ warn "No longer necessary to set nrpe_pidfile in rc.conf[.local]"
+
+ install -d -o @nrpe_user@ ${pidfile%/*}
+}
+
+run_rc_command "$1"