Selaa lähdekoodia

Changes from Solaris 10 testing and a couple minor fixes.

John C. Frickson 9 vuotta sitten
vanhempi
commit
2c4ee42c3b
10 muutettua tiedostoa jossa 146 lisäystä ja 240 poistoa
  1. 86 34
      Makefile.in
  2. 2 2
      build-aux/ax_nagios_get_files
  3. 4 4
      build-aux/ax_nagios_get_paths
  4. 11 9
      configure
  5. 4 2
      configure.ac
  6. 1 1
      src/Makefile.in
  7. 3 2
      src/check_nrpe.c
  8. 3 2
      src/nrpe.c
  9. 0 152
      startup/solaris-PKG_NAME.xml.in
  10. 32 32
      uninstall.in

+ 86 - 34
Makefile.in

@@ -13,19 +13,24 @@ CC=@CC@
 CFLAGS=@CFLAGS@ @DEFS@
 LDFLAGS=@LDFLAGS@ @LIBS@
 
+INSTALL=@INSTALL@
+GREP=@GREP@
+EGREP=@EGREP@
+
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 CFGDIR=@pkgsysconfdir@
 BINDIR=@bindir@
 SBINDIR=@sbindir@
 LIBEXECDIR=@libexecdir@
-INSTALL=@INSTALL@
 NAGIOS_INSTALL_OPTS=@NAGIOS_INSTALL_OPTS@
 NRPE_INSTALL_OPTS=@NRPE_INSTALL_OPTS@
 OPSYS=@opsys@
 DIST=@dist_type@
-USERID=@nrpe_user@
-GRPID=@nrpe_group@
+NRPE_USER=@nrpe_user@
+NRPE_GROUP=@nrpe_group@
+NAGIOS_USER=@nagios_user@
+NAGIOS_GROUP=@nagios_group@
 
 INIT_TYPE=@init_type@
 INIT_DIR=@initdir@
@@ -48,9 +53,9 @@ default:
 	echo "     install            install nrpe and check_nrpe";\
 	echo "     install-plugin     install the check_nrpe plugin";\
 	echo "     install-daemon     install the nrpe daemon";\
-	echo "     install-group      add the $GRPID group id if it does not exist";\
-	echo "     install-user       add the $USERID user id if it does not exist";\
-	echo "     install-group-user add the $USERID user and $GRPID group";\
+	echo "     install-group      add the groups if they do not exist";\
+	echo "     install-user       add the user ids if they do not exist";\
+	echo "     install-group-user add the users and groups if they do not exist";\
 	echo "     install-config     install the nrpe configuration file";\
 	echo "     install-inetd      install the startup files for inetd, launchd, etc.";\
 	echo "     install-init       install the startup files for init, systemd, etc.";\
@@ -63,8 +68,7 @@ all:
 	@echo "";\
 	echo "*** Compile finished ***";\
 	echo "";\
-	echo "If the NRPE daemon and client compiled without any errors, you";\
-	echo "can continue with the installation or upgrade process.";\
+	echo "You can now continue with the installation or upgrade process.";\
 	echo "";\
 	echo "Read the PDF documentation (NRPE.pdf) for information on the next";\
 	echo "steps you should take to complete the installation or upgrade.";\
@@ -91,18 +95,22 @@ install-inetd:
 		exit 1; \
 	fi
 	@if test $(INETD_TYPE) = inetd; then \
-		grep -E -q "^\W*nrpe\s+" $(INETD_DIR)/$(INETD_FILE) || \
+		$(EGREP) -q "^\W*nrpe\s+" $(INETD_DIR)/$(INETD_FILE) || \
 		   cat startup/$(SRC_INETD) >> $(INETD_DIR)/$(INETD_FILE); \
-	else \
+	elifif test $(INETD_TYPE) = systemd; then \
+		SRC_INETD_FILE=`echo "$(SRC_INETD)" | sed -e 's/socket/socket-svc/'`; \
+		echo $(INSTALL) -m 644 startup/$$SRC_INETD_FILE $(INETD_DIR)/$(INIT_FILE); \
+		$(INSTALL) -m 644 startup/$$SRC_INETD_FILE $(INETD_DIR)/$(INIT_FILE); \
+	elif test $(INETD_TYPE) = smf10 -o $(INETD_TYPE) = smf11; then \
+		echo svccfg import startup/$(SRC_INETD); \
+		svccfg import startup/$(SRC_INETD); \
+		echo svcadm enable nrpe; \
+		svcadm enable nrpe; \
+	else\
 		echo $(INSTALL) -m 644 startup/$(SRC_INETD) $(INETD_DIR)/$(INETD_FILE); \
 		$(INSTALL) -m 644 startup/$(SRC_INETD) $(INETD_DIR)/$(INETD_FILE); \
-		if test $(INETD_TYPE) = systemd; then \
-			SRC_INETD_FILE=`echo "$(SRC_INETD)" | sed -e 's/socket/socket-svc/'`; \
-			echo $(INSTALL) -m 644 startup/$$SRC_INETD_FILE $(INETD_DIR)/$(INIT_FILE); \
-			$(INSTALL) -m 644 startup/$$SRC_INETD_FILE $(INETD_DIR)/$(INIT_FILE); \
-		fi; \
 	fi
-	@grep -E -q "^nrpe[\t ]+5666/tcp" /etc/services || \
+	@$(EGREP) -q "^nrpe[\t ]+5666/tcp" /etc/services || \
 		echo "***** MAKE SURE 'nrpe 5666/tcp' IS IN YOUR /etc/services FILE"
 
 install-init:
@@ -118,6 +126,11 @@ install-init:
 	elif test $(INIT_TYPE) = systemd; then\
 		echo $(INSTALL) -m 644 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE); \
 		$(INSTALL) -m 644 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE); \
+	elif test $(INETD_TYPE) = smf10 -o $(INETD_TYPE) = smf11; then \
+		echo svccfg import startup/$(SRC_INIT); \
+		svccfg import startup/$(SRC_INIT); \
+		echo svcadm enable nrpe; \
+		svcadm enable nrpe; \
 	else\
 		echo $(INSTALL) -m 755 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE); \
 		$(INSTALL) -m 755 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE); \
@@ -128,35 +141,74 @@ install-config:
 	$(INSTALL) -m 644 $(NRPE_INSTALL_OPTS) sample-config/nrpe.cfg $(CFGDIR)
 
 install-group:
-	@if test $(OPSYS) = aix; then\
-		mkgroup $(GRPID);\
-	elif test $(OPSYS) = hpux -o $(OPSYS) = solaris; then\
-		groupadd $(GRPID);\
+	@if test $(DIST) = aix; then\
+		echo mkgroup $(NAGIOS_GROUP);\
+		mkgroup $(NAGIOS_GROUP);\
+		echo mkgroup $(NRPE_GROUP);\
+		mkgroup $(NRPE_GROUP);\
+	elif test $(DIST) = hpux -o $(DIST) = solaris; then\
+		echo groupadd $(NAGIOS_GROUP);\
+		groupadd $(NAGIOS_GROUP);\
+		echo groupadd $(NRPE_GROUP);\
+		groupadd $(NRPE_GROUP);\
 	elif test $(OPSYS) = osx; then\
 		newid=`dscl . -list /Groups gid | tr -s ' ' | cut -d' ' -f2 | sort -n | tail -1`;\
 		newid=`expr 1 + $newid`;\
-		dscl . -create /Groups/$(GRPID) gid $$newid;\
-	elif test $(OPSYS) = "bsd" -a $(DIST) = "freebsd"; then\
-		pw add group $(GRPID);\
+		newid=`expr 1 + $newid`;\
+		echo dscl . -create /Groups/$(NAGIOS_GROUP) gid $$newid;\
+		dscl . -create /Groups/$(NAGIOS_GROUP) gid $$newid;\
+		newid=`expr 1 + $newid`;\
+		echo dscl . -create /Groups/$(NRPE_GROUP) gid $$newid;\
+		dscl . -create /Groups/$(NRPE_GROUP) gid $$newid;\
+	elif test $(DIST) = "freebsd"; then\
+		echo pw add group $(NAGIOS_GROUP);\
+		pw add group $(NAGIOS_GROUP);\
+		echo pw add group $(NRPE_GROUP);\
+		pw add group $(NRPE_GROUP);\
 	else\
-		groupadd -r $(GRPID);\
+		echo groupadd -r $(NAGIOS_GROUP);\
+		groupadd -r $(NAGIOS_GROUP);\
+		echo groupadd -r $(NRPE_GROUP);\
+		groupadd -r $(NRPE_GROUP);\
 	fi
 
 install-user:
-	@if test $(OPSYS) = aix; then\
-		useradd -g $(GRPID) $(USERID);\
-	elif test $(OPSYS) = hpux -o $(OPSYS) = solaris; then\
-		useradd -g $(GRPID) $(USERID);\
+	@if test $(DIST) = aix; then\
+		echo useradd -g $(NAGIOS_GROUP) $(NAGIOS_USER);\
+		useradd -g $(NAGIOS_GROUP) $(NAGIOS_USER);\
+		echo useradd -g $(NRPE_GROUP) $(NRPE_USER);\
+		useradd -g $(NRPE_GROUP) $(NRPE_USER);\
+	elif test $(DIST) = hpux -o $(DIST) = solaris; then\
+		echo useradd -g $(NAGIOS_GROUP) $(NAGIOS_USER);\
+		useradd -g $(NAGIOS_GROUP) $(NAGIOS_USER);\
+		echo useradd -g $(NRPE_GROUP) $(NRPE_USER);\
+		useradd -g $(NRPE_GROUP) $(NRPE_USER);\
 	elif test $(OPSYS) = osx; then\
 		newid=`dscl . -list /Users UniqueID | tr -s ' ' | cut -d' ' -f2 | sort -n | tail -1`;\
 		newid=`expr 1 + $newid`;\
-		dscl . -create /Users/$(USERID);\
-		dscl . -create /Users/$(USERID) UniqueID $$newid;\
-		dscl . -append /Groups/$(GRPID) GroupMembership $(USERID);\
-	elif test $(OPSYS) = "bsd" -a $(DIST) = "freebsd"; then\
-		pw add user -g $(GRPID) $(USERID);\
+		echo dscl . -create /Users/$(NAGIOS_USER);\
+		echo dscl . -create /Users/$(NAGIOS_USER) UniqueID $$newid;\
+		echo dscl . -append /Groups/$(NAGIOS_GROUP) GroupMembership $(NAGIOS_USER);\
+		dscl . -create /Users/$(NAGIOS_USER);\
+		dscl . -create /Users/$(NAGIOS_USER) UniqueID $$newid;\
+		dscl . -append /Groups/$(NAGIOS_GROUP) GroupMembership $(NAGIOS_USER);\
+		newid=`expr 1 + $newid`;\
+		echo dscl . -create /Users/$(NRPE_USER);\
+		echo dscl . -create /Users/$(NRPE_USER) UniqueID $$newid;\
+		echo dscl . -append /Groups/$(NRPE_GROUP) GroupMembership $(NRPE_USER);\
+		dscl . -create /Users/$(NRPE_USER);\
+		dscl . -create /Users/$(NRPE_USER) UniqueID $$newid;\
+		dscl . -append /Groups/$(NRPE_GROUP) GroupMembership $(NRPE_USER);\
+	elif test $(DIST) = "freebsd"; then\
+		echo pw add user -g $(NAGIOS_GROUP) $(NAGIOS_USER);\
+		pw add user -g $(NAGIOS_GROUP) $(NAGIOS_USER);\
+		echo pw add user -g $(NRPE_GROUP) $(NRPE_USER);\
+		pw add user -g $(NRPE_GROUP) $(NRPE_USER);\
 	else\
-		useradd -r -g $(GRPID) $(USERID);\
+		echo useradd -r -g $(NAGIOS_GROUP) $(NAGIOS_USER);\
+		useradd -r -g $(NAGIOS_GROUP) $(NAGIOS_USER);\
+		echo useradd -r -g $(NRPE_GROUP) $(NRPE_USER);\
+		useradd -r -g $(NRPE_GROUP) $(NRPE_USER);\
 	fi
 
 install-group-user:

+ 2 - 2
build-aux/ax_nagios_get_files

@@ -75,8 +75,8 @@ AS_CASE([$init_type],
 		src_init=openrc-init,
 
 	[smf*],
-		src_init="solaris-PKG_NAME.xml"
-		src_inetd="solaris-PKG_NAME.xml",
+		src_init="solaris-init.xml"
+		src_inetd="solaris-inetd.xml",
 
 	[upstart],
 		if test $dist_type = rh ; then

+ 4 - 4
build-aux/ax_nagios_get_paths

@@ -212,14 +212,14 @@ AC_ARG_WITH(pipedir, AC_HELP_STRING([--with-pipedir=DIR],
 
 if test $install_method = "default"; then
 	if test $opsys = "unix"; then
-		if test x"$prefix" = "xNONE"; then prefix="/usr/local/$PKG_NAME"; fi
+		if test x"$prefix" = "xNONE"; then prefix="/usr/local/nagios"; fi
 	else
 		if test x"$prefix" = "xNONE"; then prefix=${ac_default_prefix}; fi
 	fi
 	datarootdir=${datarootdir="$prefix"}
 
 elif test $install_method = "opt"; then
-	if test x"$prefix" = "xNONE"; then prefix="/opt/$PKG_NAME"; fi
+	if test x"$prefix" = "xNONE"; then prefix="/opt/nagios"; fi
 
 else
 	if test x"$datadir" = x'${datarootdir}'; then AS_UNSET(datadir); fi
@@ -651,9 +651,9 @@ AS_CASE([$init_type],
 
 	[smf*],
 		if test $init_type = smf10; then
-			initdir=${initdir="/var/svc/manifest/network"}
+			initdir=${initdir="/var/svc/manifest/network/nagios"}
 		else
-			initdir=${initdir="/lib/svc/manifest/network"}
+			initdir=${initdir="/lib/svc/manifest/network/nagios"}
 		fi
 		initname=${initname="$PKG_NAME.xml"}
 		initconfdir=unknown

+ 11 - 9
configure

@@ -3284,14 +3284,14 @@ fi
 
 if test $install_method = "default"; then
 	if test $opsys = "unix"; then
-		if test x"$prefix" = "xNONE"; then prefix="/usr/local/$PKG_NAME"; fi
+		if test x"$prefix" = "xNONE"; then prefix="/usr/local/nagios"; fi
 	else
 		if test x"$prefix" = "xNONE"; then prefix=${ac_default_prefix}; fi
 	fi
 	datarootdir=${datarootdir="$prefix"}
 
 elif test $install_method = "opt"; then
-	if test x"$prefix" = "xNONE"; then prefix="/opt/$PKG_NAME"; fi
+	if test x"$prefix" = "xNONE"; then prefix="/opt/nagios"; fi
 
 else
 	if test x"$datadir" = x'${datarootdir}'; then { datadir=; unset datadir;}; fi
@@ -3718,9 +3718,9 @@ case $init_type in #(
 		initconf=${initconf="$initconfdir/$PKG_NAME"} ;; #(
   smf*) :
     if test $init_type = smf10; then
-			initdir=${initdir="/var/svc/manifest/network"}
+			initdir=${initdir="/var/svc/manifest/network/nagios"}
 		else
-			initdir=${initdir="/lib/svc/manifest/network"}
+			initdir=${initdir="/lib/svc/manifest/network/nagios"}
 		fi
 		initname=${initname="$PKG_NAME.xml"}
 		initconfdir=unknown
@@ -3812,8 +3812,8 @@ case $init_type in #(
 	openrc) :
     src_init=openrc-init ;; #(
   smf*) :
-    src_init="solaris-PKG_NAME.xml"
-		src_inetd="solaris-PKG_NAME.xml" ;; #(
+    src_init="solaris-init.xml"
+		src_inetd="solaris-inetd.xml" ;; #(
   upstart) :
     if test $dist_type = rh ; then
 			src_init=rh-upstart-init
@@ -4945,7 +4945,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 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/newbsd-init startup/openrc-conf startup/openrc-init startup/solaris-PKG_NAME.xml startup/tmpfile.conf startup/upstart-init startup/rh-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/newbsd-init startup/openrc-conf startup/openrc-init startup/solaris-init.xml startup/solaris-inetd.xml startup/tmpfile.conf startup/upstart-init startup/rh-upstart-init"
 
 
 ac_ext=c
@@ -7291,7 +7291,8 @@ $as_echo_n "checking for SSL headers... " >&6; }
 	found_ssl=no
 	for dir in $ssl_inc_dir $ssl_dir /usr/local/openssl /usr/local/opt/openssl \
 				/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr \
-				/usr/freeware/lib/openssl /usr/sfw/include /opt/openssl; do
+				/usr/freeware/lib/openssl /usr/sfw /usr/sfw/include \
+				/opt/openssl; do
 		ssldir="$dir"
 		if test -f "$dir/include/openssl/ssl.h"; then
 			found_ssl=yes
@@ -8237,7 +8238,8 @@ do
     "startup/newbsd-init") CONFIG_FILES="$CONFIG_FILES startup/newbsd-init" ;;
     "startup/openrc-conf") CONFIG_FILES="$CONFIG_FILES startup/openrc-conf" ;;
     "startup/openrc-init") CONFIG_FILES="$CONFIG_FILES startup/openrc-init" ;;
-    "startup/solaris-PKG_NAME.xml") CONFIG_FILES="$CONFIG_FILES startup/solaris-PKG_NAME.xml" ;;
+    "startup/solaris-init.xml") CONFIG_FILES="$CONFIG_FILES startup/solaris-init.xml" ;;
+    "startup/solaris-inetd.xml") CONFIG_FILES="$CONFIG_FILES startup/solaris-inetd.xml" ;;
     "startup/tmpfile.conf") CONFIG_FILES="$CONFIG_FILES startup/tmpfile.conf" ;;
     "startup/upstart-init") CONFIG_FILES="$CONFIG_FILES startup/upstart-init" ;;
     "startup/rh-upstart-init") CONFIG_FILES="$CONFIG_FILES startup/rh-upstart-init" ;;

+ 4 - 2
configure.ac

@@ -118,7 +118,8 @@ AC_CONFIG_FILES([Makefile
 	startup/newbsd-init
 	startup/openrc-conf
 	startup/openrc-init
-	startup/solaris-PKG_NAME.xml
+	startup/solaris-init.xml
+	startup/solaris-inetd.xml
 	startup/tmpfile.conf
 	startup/upstart-init
 	startup/rh-upstart-init
@@ -357,7 +358,8 @@ if test x$check_for_ssl = xyes; then
 	found_ssl=no
 	for dir in $ssl_inc_dir $ssl_dir /usr/local/openssl /usr/local/opt/openssl \
 				/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr \
-				/usr/freeware/lib/openssl /usr/sfw/include /opt/openssl; do
+				/usr/freeware/lib/openssl /usr/sfw /usr/sfw/include \
+				/opt/openssl; do
 		ssldir="$dir"
 		if test -f "$dir/include/openssl/ssl.h"; then
 			found_ssl=yes

+ 1 - 1
src/Makefile.in

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

+ 3 - 2
src/check_nrpe.c

@@ -46,7 +46,8 @@ int show_version = FALSE;
 int packet_ver = NRPE_PACKET_VERSION_3;
 
 #ifdef HAVE_SSL
-# if (defined(__sun) && defined(__SunOS_5_10)) || defined(_AIX) || defined(__hpux)
+/* # if (defined(__sun) && defined(__SunOS_5_10)) || defined(_AIX) || defined(__hpux) */
+# if defined(__sun) || defined(_AIX) || defined(__hpux)
 SSL_METHOD *meth;
 # else
 const SSL_METHOD *meth;
@@ -672,7 +673,7 @@ int connect_to_remote()
 		if (sslprm.log_opts & SSL_LogCipher) {
 			const SSL_CIPHER *c = SSL_get_current_cipher(ssl);
 			syslog(LOG_NOTICE, "Remote %s - %s, Cipher is %s", rem_host,
-				   SSL_CIPHER_get_version(c), SSL_CIPHER_get_name(c));
+				   (char*)SSL_CIPHER_get_version(c), (char*)SSL_CIPHER_get_name(c));
 		}
 
 		if ((sslprm.log_opts & SSL_LogIfClientCert) || (sslprm.log_opts & SSL_LogCertDetails)) {

+ 3 - 2
src/nrpe.c

@@ -49,7 +49,8 @@ int       rfc931_timeout=15;
 #endif
 
 #ifdef HAVE_SSL
-# if (defined(__sun) && defined(__SunOS_5_10)) || defined(_AIX) || defined(__upux)
+/* # if (defined(__sun) && defined(__SunOS_5_10)) || defined(_AIX) || defined(__hpux) */
+# if defined(__sun) || defined(_AIX) || defined(__hpux)
 SSL_METHOD *meth;
 # else
 const SSL_METHOD *meth;
@@ -1771,7 +1772,7 @@ int handle_conn_ssl(int sock, void *ssl_ptr)
 	if (sslprm.log_opts & SSL_LogCipher) {
 		c = SSL_get_current_cipher(ssl);
 		syslog(LOG_NOTICE, "Remote %s - %s, Cipher is %s", remote_host,
-			   SSL_CIPHER_get_version(c), SSL_CIPHER_get_name(c));
+			   (char*)SSL_CIPHER_get_version(c), (char*)SSL_CIPHER_get_name(c));
 	}
 
 	if ((sslprm.log_opts & SSL_LogIfClientCert)

+ 0 - 152
startup/solaris-PKG_NAME.xml.in

@@ -1,152 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
-
-<!--
-	This is a manifest file for the nrpe service. Import it using
-		svccfg import <path/to/this/file>
-	and enable it using
-		svcadm enable nrpe
--->
-
-<service_bundle type='manifest' name='NGOS:nrpe'>
-
-	<service
-		name='network/nagios/nrpe'
-		version='1'
-		type='service'>
-
-		<single_instance />
-
-		<dependency
-			name='fs-local'
-			grouping='require_all'
-			restart_on='none'
-			type='service'>
-				<service_fmri value='svc:/system/filesystem/local' />
-		</dependency>
-
-		<dependency
-			name='autofs'
-			grouping='optional_all'
-			restart_on='none'
-			type='service'>
-			<service_fmri value='svc:/system/filesystem/autofs' />
-		</dependency>
-
-		<dependency name='net-loopback'
-			grouping='require_all'
-			restart_on='none'
-			type='service'>
-			<service_fmri value='svc:/network/loopback' />
-		</dependency>
-
-		<dependency name='net-physical'
-			grouping='require_all'
-			restart_on='none'
-			type='service'>
-			<service_fmri value='svc:/network/physical' />
-		</dependency>
-
-		<dependency name='cryptosvc'
-			grouping='require_all'
-			restart_on='none'
-			type='service'>
-			<service_fmri value='svc:/system/cryptosvc' />
-		</dependency>
-
-		<dependency name='utmp'
-			grouping='require_all'
-			restart_on='none'
-			type='service'>
-			<service_fmri value='svc:/system/utmp' />
-		</dependency>
-
-		<dependency name='config_data'
-			grouping='require_all'
-			restart_on='restart'
-			type='path'>
-			<service_fmri
-			    value='file://localhost/pkg@sysconfdir@/nrpe.cfg' />
-		</dependency>
-
-		<dependency
-			name='system-log'
-			grouping='optional_all'
-			restart_on='none'
-			type='service'>
-			<service_fmri value='svc:/system/system-log' />
-		</dependency>
-
-		<dependent
-			name='nrpe_multi-user-server'
-			grouping='optional_all'
-			restart_on='none'>
-				<service_fmri
-				    value='svc:/milestone/multi-user-server' />
-		</dependent>
-
-		<method_context>
-			<method_credential user='@nrpe_user@' group='@nrpe_group@'/>
-			<method_environment>
-				<envvar name='BASEDIR' value='/export/home/@nrpe_user@'/>
-			</method_environment>
-		</method_context>
-
-		<exec_method
-			type='method'
-			name='start'
-			exec='/usr/sfw/sbin/tcpd -c @pkgsysconfdir@/nrpe.cfg -i'
-			arg0='@sbindir@/nrpe'
-			timeout_seconds='60'/>
-
-		<exec_method
-			type='method'
-			name='stop'
-			exec=':kill'
-			timeout_seconds='60'/>
-
-		<exec_method
-			type='method'
-			name='refresh'
-			exec=':hup'
-			timeout_seconds='60'/>
-
-		<property_group name='startd' type='framework'>
-			<propval name='ignore_error'
-				type='astring'
-				value='core,signal' />
-		</property_group>
-
-		<property_group name='general' type='framework'>
-			<propval name='enabled'
-				type='boolean'
-				value='false'/>
-			<propval name='action_authorization'
-				type='astring'
-				value='solaris.smf.manage.nrpe'/>
-			<propval name='value_authorization'
-				type='astring'
-				value='solaris.smf.manage.nrpe'/>
-		</property_group>
-
-		<stability value='Unstable' />
-
-		<create_default_instance name='default' enabled='false' />
-
-		<template>
-			<common_name>
-				<loctext xml:lang="C">NRPE daemon</loctext>
-			</common_name>
-			<description>
-				<loctext xml:lang="C">
-					Nagios Remote Plugin Executor daemon
-				</loctext>
-			</description>
-			<documentation>
-				<doc_link name='nagios.org' uri='http://www.nagios.org' />
-			</documentation>
-		</template>
-
-	</service>
-
-</service_bundle>

+ 32 - 32
uninstall.in

@@ -36,7 +36,7 @@ GRPID=@nrpe_group@
 
 
 # Display usage message
-usage () {
+usage() {
 	echo "Usage: $0 [-q] [-p] [-v] progs|config|startup|user|group|script|all"
 	echo "   Optional args:"
 	echo "      -q       Do not print what is happening"
@@ -53,7 +53,7 @@ usage () {
 	exit 1
 }
 
-get_opts () {
+get_opts() {
 	while test $# -gt 0 ; do
 		arg=$1
 		shift
@@ -87,7 +87,7 @@ get_opts () {
 	fi
 }
 
-prt_msg () {
+prt_msg() {
 	if test $quiet -eq 1 ; then
 		return 0
 	fi
@@ -122,7 +122,7 @@ prt_msg () {
 	return 0
 }
 
-rm_progs () {
+rm_progs() {
 	num=0
 	prt_msg 1 0 0 "*** Uninstalling Progs"
 
@@ -168,7 +168,7 @@ rm_progs () {
 	fi
 }
 
-rm_startup () {
+rm_startup() {
 	num=0
 	prt_msg 1 0 0 "*** Uninstalling Startup"
 
@@ -275,7 +275,7 @@ rm_startup () {
 	fi
 }
 
-rm_config () {
+rm_config() {
     num=0
 	prt_msg 1 0 0 "*** Uninstalling Config"
 
@@ -296,42 +296,42 @@ rm_config () {
 	fi
 }
 
-rm_user () {
-	prt_msg 1 0 0 "*** Removing user $(USERID)"
-	prt_msg 2 0 1 "Delete $(USERID)" || return
-
-	if test $(OPSYS) = aix; then
-		rmuser -p $(USERID)
-	elif test $(OPSYS) = osx; then
-		dscl . -delete /Groups/$(GRPID) GroupMembership $(USERID)
-		dscl . -delete /Users name $(USERID)
-	elif test $(OPSYS) = "bsd" -a $(DIST) = "freebsd"; then
-		pw del user $(USERID)
+rm_user() {
+	prt_msg 1 0 0 "*** Removing user ${USERID}"
+	prt_msg 2 0 1 "Delete ${USERID}" || return
+
+	if test ${OPSYS} = aix; then
+		rmuser -p ${USERID}
+	elif test ${OPSYS} = osx; then
+		dscl . -delete /Groups/${GRPID} GroupMembership ${USERID}
+		dscl . -delete /Users name ${USERID}
+	elif test ${DIST} = "freebsd"; then
+		pw del user ${USERID}
 	else
-		userdel $(USERID)
+		userdel ${USERID}
 	fi
 }
 
-rm_group () {
-	prt_msg 1 0 0 "*** Removing group $(GROUPID)"
-	prt_msg 2 0 1 "Delete $(GROUPID)" || return
+rm_group() {
+	prt_msg 1 0 0 "*** Removing group ${GROUPID}"
+	prt_msg 2 0 1 "Delete ${GROUPID}" || return
 
-	if test $(OPSYS) = aix; then
-		rmgroup -p $(GRPID)
-	elif test $(OPSYS) = osx; then
-		dscl . -delete /Groups/$(GRPID)
-	elif test $(OPSYS) = "bsd" -a $(DIST) = "freebsd"; then
-		pw del group $(GRPID)
+	if test ${OPSYS} = aix; then
+		rmgroup -p ${GRPID}
+	elif test ${OPSYS} = osx; then
+		dscl . -delete /Groups/${GRPID}
+	elif test ${DIST} = "freebsd"; then
+		pw del group ${GRPID}
 	else
-		groupdel $(GRPID)
+		groupdel ${GRPID}
 	fi
 }
 
-rm_script () {
-	prt_msg 1 0 0 "*** Removing $(myname)"
-	prt_msg 2 0 1 "Delete $(myname)" || return
+rm_script() {
+	prt_msg 1 0 0 "*** Removing ${myname}"
+	prt_msg 2 0 1 "Delete ${myname}" || return
 
-    rm "$(myname)"
+    rm "${myname)"
 }
 
 get_opts $@