Skip to content

Commit

Permalink
Minor changes to startup files and added uninstall script
Browse files Browse the repository at this point in the history
  • Loading branch information
John C. Frickson committed Apr 26, 2016
1 parent 64914ad commit b029fa3
Show file tree
Hide file tree
Showing 12 changed files with 265 additions and 42 deletions.
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@ config.status
include/config.h
include/dh.h
nrpe.spec
paths
uninstall
.cproject
.project
package/solaris/Makefile
sample-config/nrpe.cfg
src/Makefile
src/check_nrpe
src/nrpe
autom4te.cache/
nbproject/
.cproject
.project
.settings/
paths
startup/bsd-init
startup/debian-init
startup/default-inetd
startup/default-init
startup/default-service
startup/default-socket
startup/default-socket-svc
startup/default-xinetd
startup/mac-org.nagios.PKG_NAME.plist
startup/openrc-conf
Expand Down
4 changes: 3 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -4823,7 +4823,7 @@ fi
ac_config_headers="$ac_config_headers include/config.h"
ac_config_files="$ac_config_files Makefile src/Makefile package/solaris/Makefile nrpe.spec sample-config/nrpe.cfg startup/bsd-init startup/debian-init startup/default-init startup/default-inetd startup/default-service startup/default-socket startup/default-xinetd startup/mac-org.nagios.PKG_NAME.plist startup/openrc-conf startup/openrc-init startup/solaris-PKG_NAME.xml startup/upstart-init"
ac_config_files="$ac_config_files Makefile src/Makefile package/solaris/Makefile nrpe.spec uninstall sample-config/nrpe.cfg startup/bsd-init startup/debian-init startup/default-init startup/default-inetd startup/default-service startup/default-socket startup/default-socket-svc startup/default-xinetd startup/mac-org.nagios.PKG_NAME.plist startup/openrc-conf startup/openrc-init startup/solaris-PKG_NAME.xml startup/upstart-init"
#sample-config/debian-nrpe-inetd
Expand Down Expand Up @@ -8062,13 +8062,15 @@ do
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"package/solaris/Makefile") CONFIG_FILES="$CONFIG_FILES package/solaris/Makefile" ;;
"nrpe.spec") CONFIG_FILES="$CONFIG_FILES nrpe.spec" ;;
"uninstall") CONFIG_FILES="$CONFIG_FILES uninstall" ;;
"sample-config/nrpe.cfg") CONFIG_FILES="$CONFIG_FILES sample-config/nrpe.cfg" ;;
"startup/bsd-init") CONFIG_FILES="$CONFIG_FILES startup/bsd-init" ;;
"startup/debian-init") CONFIG_FILES="$CONFIG_FILES startup/debian-init" ;;
"startup/default-init") CONFIG_FILES="$CONFIG_FILES startup/default-init" ;;
"startup/default-inetd") CONFIG_FILES="$CONFIG_FILES startup/default-inetd" ;;
"startup/default-service") CONFIG_FILES="$CONFIG_FILES startup/default-service" ;;
"startup/default-socket") CONFIG_FILES="$CONFIG_FILES startup/default-socket" ;;
"startup/default-socket-svc") CONFIG_FILES="$CONFIG_FILES startup/default-socket-svc" ;;
"startup/default-xinetd") CONFIG_FILES="$CONFIG_FILES startup/default-xinetd" ;;
"startup/mac-org.nagios.PKG_NAME.plist") CONFIG_FILES="$CONFIG_FILES startup/mac-org.nagios.PKG_NAME.plist" ;;
"startup/openrc-conf") CONFIG_FILES="$CONFIG_FILES startup/openrc-conf" ;;
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ AC_CONFIG_FILES([Makefile
src/Makefile
package/solaris/Makefile
nrpe.spec
uninstall
sample-config/nrpe.cfg
startup/bsd-init
startup/debian-init
startup/default-init
startup/default-inetd
startup/default-service
startup/default-socket
startup/default-socket-svc
startup/default-xinetd
startup/mac-org.nagios.PKG_NAME.plist
startup/openrc-conf
Expand Down
9 changes: 6 additions & 3 deletions src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,22 @@ install:
$(MAKE) install-plugin
$(MAKE) install-daemon

install-plugin:
install-plugin: install-uninstall
$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(LIBEXECDIR)
$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(PLUGINSDIR)
$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) check_nrpe $(PLUGINSDIR)

install-daemon:
$(INSTALL) -m 755 -d $(SBINDIR)
install-daemon: install-uninstall
$(INSTALL) -m 755 nrpe $(SBINDIR)
@if ! test -d "$PIDDIR" ; then \
echo $(INSTALL) -m 755 $(NRPE_INSTALL_OPTS) -d $(PIDDIR); \
$(INSTALL) -m 755 $(NRPE_INSTALL_OPTS) -d $(PIDDIR); \
fi

install-uninstall:
$(INSTALL) -m 755 -d $(SBINDIR)
$(INSTALL) -m 755 ../uninstall $(SBINDIR)/nrpe-uninstall

clean:
rm -f core nrpe check_nrpe $(SNPRINTF_O)
rm -f *~ */*~
Expand Down
2 changes: 1 addition & 1 deletion startup/default-service.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Type=simple
Restart=on-abort
PIDFile=@piddir@/nrpe.pid
RuntimeDirectory=nrpe
RuntimeMode=0755
RuntimeDirectoryMode=0755
ExecStart=@sbindir@/nrpe -c @pkgsysconfdir@/nrpe.cfg -f
ExecStopPost=/bin/rm -f @piddir@/nrpe.pid
TimeoutStopSec=60
Expand Down
16 changes: 16 additions & 0 deletions startup/default-socket-svc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Nagios Remote Program Executor
Documentation=http://www.nagios.org/documentation
After=var-run.mount nss-lookup.target network.target local-fs.target time-sync.target

[Service]
Restart=on-failure
ExecStart=@sbindir@/nrpe -c @pkgsysconfdir@/nrpe.cfg -f
KillMode=process
User=@nagios_user@
Group=@nagios_group@
PrivateTmp=true
OOMScoreAdjust=-500

[Install]
WantedBy=multi-user.target
18 changes: 6 additions & 12 deletions startup/default-socket.in
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
[Unit]
Description=Nagios Remote Program Executor
Documentation=http://www.nagios.org/documentation
After=var-run.mount nss-lookup.target network.target local-fs.target time-sync.target
Before=getty@tty1.service plymouth-quit.service xdm.service
Before=nrpe.service
Conflicts=nrpe.service

[Install]
WantedBy=multi-user.target
[Socket]
ListenStream=@nrpe_port@
Accept=yes

[Service]
Accept=true
ExecStart=@sbindir@/nrpe -c @pkgsysconfdir@/nrpe.cfg -i
TimeoutStopSec=60
User=@nagios_user@
Group=@nagios_group@
PrivateTmp=true
OOMScoreAdjust=-500
[Install]
WantedBy=sockets.target
1 change: 1 addition & 0 deletions startup/mac-org.nagios.PKG_NAME.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<array>
<string>-c</string>
<string>@pkgsysconfdir@/nrpe.cfg</string>
<string>-i</string>
</array>
<key>KeepAlive</key>
<dict>
Expand Down
2 changes: 1 addition & 1 deletion startup/openrc-init.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ start() {
# Make sure we have a sane current directory
cd /
start-stop-daemon --start --exec $NRPE_BIN --pidfile $PID_FILE \
-- -c $NRPE_CFG -d $NRPE_OPTS
-- -c $NRPE_CFG -f $NRPE_OPTS
eend $?
}

Expand Down
20 changes: 0 additions & 20 deletions startup/upstart-init

This file was deleted.

2 changes: 1 addition & 1 deletion startup/upstart-init.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ stop on runlevel [!2345]
expect daemon
respawn

exec @sbindir@/nrpe -c @pkgsysconfdir@/nrpe.cfg -d
exec @sbindir@/nrpe -c @pkgsysconfdir@/nrpe.cfg -f
Loading

0 comments on commit b029fa3

Please sign in to comment.