ソースを参照

Init script for SUSE

Ethan Galstad 22 年 前
コミット
ad138bf13d
6 ファイル変更95 行追加7 行削除
  1. 1 0
      Changelog
  2. 1 1
      Makefile.in
  3. 1 0
      configure
  4. 1 0
      configure.in
  5. 6 6
      include/dh.h
  6. 85 0
      init-script.suse.in

+ 1 - 0
Changelog

@@ -9,6 +9,7 @@ NRPE Changelog
 - Removed length restrictions for command names and command lines
 - Configure script patch for getopt_long on Solaris
 - Bug fixes for accept() on HP-UX 11.0
+- Init script for SUSE Linux (Subhendu Ghosh)
 
 
 2.0 - 09/08/2003

+ 1 - 1
Makefile.in

@@ -51,7 +51,7 @@ clean:
 
 distclean: clean
 	cd $(SRC_BASE); $(MAKE) $@ ; cd ..
-	rm -f config.log config.status config.cache nrpe.cfg nrpe.xinetd subst $(SRC_INCLUDE)/config.h init-script init-script.debian init-script.freebsd
+	rm -f config.log config.status config.cache nrpe.cfg nrpe.xinetd subst $(SRC_INCLUDE)/config.h init-script init-script.debian init-script.freebsd init-script.suse
 	rm -f sample-config/*.cfg sample-config/*.xinetd
 	rm -f Makefile
 

+ 1 - 0
configure

@@ -2620,6 +2620,7 @@ test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 perl subst init-script
 perl subst init-script.debian
 perl subst init-script.freebsd
+perl subst init-script.suse
 perl subst sample-config/nrpe.cfg
 perl subst sample-config/nrpe.xinetd
 

+ 1 - 0
configure.in

@@ -209,6 +209,7 @@ AC_OUTPUT(Makefile src/Makefile subst)
 perl subst init-script
 perl subst init-script.debian
 perl subst init-script.freebsd
+perl subst init-script.suse
 perl subst sample-config/nrpe.cfg
 perl subst sample-config/nrpe.xinetd
 

+ 6 - 6
include/dh.h

@@ -4,12 +4,12 @@
 DH *get_dh512()
 	{
 	static unsigned char dh512_p[]={
-		0xD1,0xA7,0x39,0x62,0x2D,0xC5,0xE3,0xC4,0x37,0x3F,0x49,0x4E,
-		0x62,0x78,0x26,0x77,0x31,0xE0,0x60,0x2C,0xA5,0x91,0x93,0x6C,
-		0x8E,0x17,0xA5,0x80,0x08,0xDE,0x19,0x5C,0x67,0x86,0xE9,0xD1,
-		0x10,0x61,0xA2,0xA2,0xF2,0xCF,0xC9,0xDA,0x85,0x70,0xE5,0x64,
-		0xEF,0xB1,0xB7,0x03,0x54,0x92,0x50,0xEA,0x3D,0x6D,0x17,0xFE,
-		0x4D,0x60,0x6A,0x8B,
+		0xAE,0x63,0x22,0x35,0x42,0xB6,0xE3,0x9D,0x7E,0x19,0x82,0x86,
+		0x4E,0x35,0x2E,0xB6,0xC6,0xCB,0xEE,0x31,0x12,0xC7,0x65,0xB1,
+		0x2E,0xFD,0x0D,0x5D,0x2E,0xED,0x68,0xF8,0x8F,0x34,0xFB,0x00,
+		0x78,0x12,0xCA,0x21,0x18,0x04,0x5F,0x27,0x25,0x29,0x9D,0x30,
+		0x44,0xF1,0xD4,0xC1,0x2F,0x69,0x51,0x40,0xB1,0x0C,0x09,0xA8,
+		0x3C,0x41,0x5C,0x73,
 		};
 	static unsigned char dh512_g[]={
 		0x02,

+ 85 - 0
init-script.suse.in

@@ -0,0 +1,85 @@
+#! /bin/sh
+# Copyright (c) 1996-2002 SuSE GmbH Nuernberg, Germany.  All rights reserved.
+# Modifications for NRPE Copyright (c) 2003 Subhendu Ghosh
+# Author: Christopher Mahmood <ckm+snmp@suse.de>, Remo Behn <ray+snmp@suse.de>
+# Modifications for NRPE: Subhendu Ghosh <sghosh@users.sourceforge.net>
+#
+# /etc/init.d/nrpe
+#
+### BEGIN INIT INFO
+# Provides:            nrpe
+# Required-Start:      $network
+# Required-Stop:
+# Default-Start:       2 3 5
+# Default-Stop:        0 1 6
+# Description:         start nrpe
+### END INIT INFO
+
+NRPEBIN=@bindir@/nrpe
+NRPECFG=@sysconfdir@/nrpe.cfg
+
+test -x $NRPEBIN || exit 5
+
+# Shell functions sourced from /etc/rc.status:
+#      rc_check         check and set local and overall rc status
+#      rc_status        check and set local and overall rc status
+#      rc_status -v     ditto but be verbose in local rc status
+#      rc_status -v -r  ditto and clear the local rc status
+#      rc_failed        set local and overall rc status to failed
+#      rc_failed <num>  set local and overall rc status to <num><num>
+#      rc_reset         clear local rc status (overall remains)
+#      rc_exit          exit appropriate to overall rc status
+. /etc/rc.status
+
+# First reset status of this service
+rc_reset
+
+# Return values acc. to LSB for all commands but status:
+# 0 - success
+# 1 - generic or unspecified error
+# 2 - invalid or excess argument(s)
+# 3 - unimplemented feature (e.g. "reload")
+# 4 - insufficient privilege
+# 5 - program is not installed
+# 6 - program is not configured
+# 7 - program is not running
+# 
+# Note that starting an already running service, stopping
+# or restarting a not-running service as well as the restart
+# with force-reload (in case signalling is not supported) are
+# considered a success.
+
+
+case "$1" in
+    start)
+	echo -n "Starting nrpe:"
+	startproc $NRPEBIN -c $NRPECFG -d
+	rc_status -v
+	rc_reset
+
+	;;
+    stop)
+	echo -n "Shutting down nrpe:"
+	killproc -TERM $NRPEBIN
+	rc_status -v ; rc_reset
+
+	;;
+    restart)
+	$0 stop
+	$0 start
+	rc_status
+	;;
+    status)
+	echo -n "Checking for service nrpe:"
+	checkproc $NRPEBIN
+	rc_status -v
+	rc_reset
+
+	;;
+    *)
+	echo "Usage: $0 {start|stop|restart|status}"
+	exit 1
+	;;
+esac
+rc_exit
+