]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
install initscript for NRPE
authorPeter Müller <peter.mueller@link38.eu>
Wed, 9 May 2018 19:59:41 +0000 (21:59 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 May 2018 15:41:07 +0000 (16:41 +0100)
Install initscript for NRPE addon.

The second version of this patch actually includes the
initscript, which was missing due to lack of coffee the
first time. :-)

Thanks to Michael for catching it.

Resent due to crappy linewrapping in initscript by MUA.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/nagios_nrpe
src/initscripts/packages/nrpe [new file with mode: 0644]

index bebb80144da3147aad2ebcc4ba33a0094706e259..11ce2ae77d617110d93b85a63dc2b8a732b2e50e 100644 (file)
@@ -90,5 +90,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        cd $(DIR_APP) && make all $(MAKETUNING)
        cd $(DIR_APP) && make install
        cd $(DIR_APP) && make install-config
+
+       # install initscript
+       $(call INSTALL_INITSCRIPT,nrpe)
+
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
diff --git a/src/initscripts/packages/nrpe b/src/initscripts/packages/nrpe
new file mode 100644 (file)
index 0000000..8de798c
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh
+# Begin $rc_base/init.d/nrpe
+
+. /etc/sysconfig/rc
+. $rc_functions
+
+NRPEBIN=/usr/bin/nrpe
+NRPECFG=/etc/nagios/nrpe.cfg
+
+case "$1" in
+       start)
+               boot_mesg "Starting nrpe..."
+               loadproc $NRPEBIN -c $NRPECFG -d
+       ;;
+
+       stop)
+               boot_mesg "Stopping nrpe..."
+               killproc $NRPEBIN
+               rm -f /var/run/nrpe.pid
+       ;;
+
+       restart)
+               $0 stop
+               sleep 1
+               $0 start
+               ;;
+
+       status)
+               statusproc $NRPEBIN
+       ;;
+
+       *)
+               echo "Usage: $0 {start|stop|restart|status}"
+               exit 1
+       ;;
+esac
+
+# End $rc_base/init.d/nrpe