Parcourir la source

Minor changes to get the makefile to come out right.
Only add lines to /etc/inetd.conf if they are not there.
Print message to add nrpe to /etc/services if it's not there.

John C. Frickson il y a 9 ans
Parent
commit
089358817f
6 fichiers modifiés avec 33 ajouts et 9 suppressions
  1. 21 7
      Makefile.in
  2. 1 0
      build-aux/ax_nagios_get_paths
  3. 5 0
      configure
  4. 2 0
      configure.ac
  5. 3 1
      startup/default-inetd.in
  6. 1 1
      startup/default-xinetd.in

+ 21 - 7
Makefile.in

@@ -23,9 +23,11 @@ INSTALL=@INSTALL@
 NAGIOS_INSTALL_OPTS=@NAGIOS_INSTALL_OPTS@
 NRPE_INSTALL_OPTS=@NRPE_INSTALL_OPTS@
 
+INIT_TYPE=@init_type@
 INIT_DIR=@initdir@
 INIT_OPTS=-o root -g root
 INIT_FILE=@initname@
+INETD_TYPE=@inetd_type@
 INETD_DIR=@inetddir@
 INETD_FILE=@inetdname@
 SRC_INETD=@src_inetd@
@@ -33,7 +35,7 @@ SRC_INIT=@src_init@
 
 
 all:
-	cd $(SRC_BASE); $(MAKE); cd ..
+	cd $(SRC_BASE); $(MAKE)
 
 	@echo ""
 	@echo "*** Compile finished ***"
@@ -46,32 +48,44 @@ all:
 	@echo ""
 
 nrpe:
-	cd $(SRC_BASE); $(MAKE); cd ..
+	cd $(SRC_BASE); $(MAKE)
 
 check_nrpe:
-	cd $(SRC_BASE); $(MAKE); cd ..
+	cd $(SRC_BASE); $(MAKE)
 
 install-plugin:
-	cd $(SRC_BASE); $(MAKE) $@; cd ..
+	cd $(SRC_BASE); $(MAKE) $@
 
 install-daemon:
-	cd $(SRC_BASE); $(MAKE) $@; cd ..
+	cd $(SRC_BASE); $(MAKE) $@
 
 install:
+	cd $(SRC_BASE); $(MAKE) $@
 
 install-inetd:
 	@if test $(SRC_INETD) = unknown; then \
 		echo No inetd file to install; \
 		exit 1; \
 	fi
-	$(INSTALL) -m 644 startup/$(SRC_INETD) $(INETD_DIR)/$(INETD_FILE)
+	@if test $(INETD_TYPE) = inetd; then \
+		@grep -E -q "^\W*nrpe\s+" $(INETD_DIR)/$(INETD_FILE) || \
+		   cat startup/$(SRC_INETD) >> $(INETD_DIR)/$(INETD_FILE); \
+	else \
+		$(INSTALL) -m 644 startup/$(SRC_INETD) $(INETD_DIR)/$(INETD_FILE) \
+	fi
+	@grep -E -q "^nrpe[\t ]+5666/tcp" /etc/services || \
+		echo "***** MAKE SURE 'nrpe 5666/tcp' IS IN YOUR /etc/services FILE"
 
 install-init:
 	@if test $(SRC_INIT) = unknown; then \
 		echo No init file to install; \
 		exit 1; \
 	fi
-	$(INSTALL) -m 644 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE)
+	@if test $(INIT_TYPE) = bsd; then \
+		cat startup/$(SRC_INIT) >> $(INETD_DIR)/$(INIT_FILE) \
+	else \
+		$(INSTALL) -m 644 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE) \
+	fi
 
 install-config:
 	$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(CFGDIR)

+ 1 - 0
build-aux/ax_nagios_get_paths

@@ -500,6 +500,7 @@ eval cgibindir=$cgibindir
 eval pkglocalstatedir=$pkglocalstatedir
 eval webdir=$webdir
 eval localedir=$localedir
+eval pkgsysconfdir=$pkgsysconfdir
 
 #
 # Init scripts/files

+ 5 - 0
configure

@@ -661,6 +661,8 @@ inetdname
 initname
 objsysconfdir
 pkgsysconfdir
+inetd_type
+init_type
 TARGET_PLATFORM
 TARGET_ARCH
 TARGET_OS
@@ -2531,6 +2533,8 @@ LC_TIME=C
 
 
 
+
+
 
 
 
@@ -3556,6 +3560,7 @@ eval cgibindir=$cgibindir
 eval pkglocalstatedir=$pkglocalstatedir
 eval webdir=$webdir
 eval localedir=$localedir
+eval pkgsysconfdir=$pkgsysconfdir
 
 #
 # Init scripts/files

+ 2 - 0
configure.ac

@@ -49,6 +49,8 @@ AC_SUBST(TARGET_VER)
 AC_SUBST(TARGET_OS)
 AC_SUBST(TARGET_ARCH)
 AC_SUBST(TARGET_PLATFORM)
+AC_SUBST(init_type)
+AC_SUBST(inetd_type)
 AC_SUBST(pkgsysconfdir)
 AC_SUBST(objsysconfdir)
 AC_SUBST(sbindir)

+ 3 - 1
startup/default-inetd.in

@@ -1,2 +1,4 @@
 # Enable the following entry to enable the nrpe daemon
-#nrpe stream tcp nowait nagios @sbindir@/nrpe -c @pkgsysconfdir@/nrpe.cfg --inetd
+#nrpe stream tcp nowait @nagios_user@ @sbindir@/nrpe -c @pkgsysconfdir@/nrpe.cfg --inetd
+# Enable the following entry to enable the nrpe daemon if you have tcpwrappers
+#nrpe stream tcp nowait @nagios_user@ /usr/sbin/tcpd @sbindir@/nrpe -c @pkgsysconfdir@/nrpe.cfg --inetd

+ 1 - 1
startup/default-xinetd.in

@@ -4,7 +4,7 @@ service nrpe
 {
     disable         = yes
     socket_type     = stream
-    port            = 5666
+    port            = @NRPE_PORT@
     wait            = no
     user            = nagios
     group           = nagios