瀏覽代碼

Some changes for OS X and fix an "=" that should have been "=="

John C. Frickson 9 年之前
父節點
當前提交
f1739a6b20
共有 4 個文件被更改,包括 23 次插入20 次删除
  1. 16 10
      build-aux/ax_nagios_get_paths
  2. 4 2
      build-aux/ax_nagios_get_ssl
  3. 1 1
      src/check_nrpe.c
  4. 2 7
      startup/mac-org.plist.in

+ 16 - 10
build-aux/ax_nagios_get_paths

@@ -228,21 +228,27 @@ else
 				if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
 					libexecdir="/usr/nagios"
 				fi
+			elif test $dist_type = "osx"; then
+				datarootdir="/usr/local/share"
+				if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
+					libexecdir="/usr/local/nagios"
+				fi
 			elif test x"$libexecdir" = x'${exec_prefix}/libexec'; then
 				libexecdir="/usr/lib/nagios"
 			fi
 		fi
+		if test $dist_type = "osx"; then
+			if test x"$sbindir" = x'${exec_prefix}/sbin'; then
+				sbindir="$libexecdir"
+			fi
+			if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
+				libexecdir="/usr/local/libexec/nagios"
+			fi
+		fi
 	elif test $opsys = "bsd"; then
 		if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
 			libexecdir=${exec_prefix}/libexec/nagios;
 		fi
-	elif test $dist_type = "osx"; then
-		if test x"$sbindir" = x'${exec_prefix}/sbin'; then
-			sbindir="$libexecdir"
-		fi
-		if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
-			libexecdir="/usr/libexec/nagios"
-		fi
 	elif test x"$libexecdir" = x'${exec_prefix}/lib'; then
 		libexecdir=${libexecdir}/nagios;
 	elif test x"$libexecdir" = x'${exec_prefix}/libexec'; then
@@ -389,7 +395,7 @@ elif test $opsys = "unix"; then
 	install_method="$install_method : Unix Standard"
 	if test $dist_type = osx; then
 		install_method="$install_method : OS X Standard"
-		sbindir=${sbindir="/usr/libexec"}
+		sbindir=${sbindir="/usr/local/libexec"}
 	fi
 	datadir=${datadir="$datarootdir/nagios"}
 	if test $need_web = yes; then
@@ -644,7 +650,7 @@ AS_CASE([$init_type],
 		initconf=${initconf="$initconfdir/$PKG_NAME"},
 
 	[launchd],
-		initdir=${initdir="/System/Library/LaunchDaemons"}
+		initdir=${initdir="/Library/LaunchDaemons"}
 		initname=${initname="org.nagios.$PKG_NAME.plist"},
 #		initconfdir=${initconfdir="/private/etc"}
 #		initconf=${initconf="$initconfdir/$PKG_NAME"},
@@ -687,7 +693,7 @@ AS_CASE([$inetd_type],
 #		inetdname=${inetdname="$PKG_NAME"},
 
 	[launchd],
-		inetddir=${inetddir="/System/Library/LaunchDaemons"}
+		inetddir=${inetddir="/Library/LaunchDaemons"}
 		inetdname=${inetdname="org.nagios.$PKG_NAME.plist"},
 
 	[*],

+ 4 - 2
build-aux/ax_nagios_get_ssl

@@ -89,13 +89,13 @@ if test x$SSL_TYPE = xyes; then
 fi
 
 
-dflt_hdrs="$ssl_inc_dir $ssldir $ssldir/include $ssldir/include /usr/include/{BBB} \
+dflt_hdrs="$ssl_inc_dir $ssl_dir $ssl_dir/include $ssl_dir/include /usr/include/{BBB} \
 			/usr/local/include{BBB} /usr/local/{AAA} /usr/local/{BBB} \
 			/usr/local/opt/{BBB} /usr/lib/{AAA} /usr/lib/{BBB} /usr/{AAA} \
 			/usr/pkg /usr/local /usr /usr/freeware/lib/{BBB} /usr/sfw \
 			/usr/sfw/include /opt/{BBB}"
 
-dflt_libs="$ssl_lib_dir $ssldir $ssldir/lib $ssldir/lib64 /usr/lib64 \
+dflt_libs="$ssl_lib_dir {ssldir} {ssldir}/lib {ssldir}/lib64 /usr/lib64 \
 			/usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu \
 			/usr/local/lib /usr/lib/{AAA} /usr/{AAA}/lib /usr/{BBB}/lib \
 			/usr/pkg/lib /usr/freeware/lib/{BBB} /usr/sfw/lib /opt/freeware/lib \
@@ -205,6 +205,8 @@ if test x$SSL_TYPE != xNONE; then
 
 			AC_MSG_CHECKING(for SSL libraries)
 			found_ssl=no
+			ssl_lib_dirs=`echo "$ssl_lib_dirs" | sed -e "s|{ssldir}|$ssldir|g"`
+
 			if test "`uname -s`" = "Darwin" ; then
 				soext="dylib"
 			elif test "`uname -s`" = "HP-UX" ; then

+ 1 - 1
src/check_nrpe.c

@@ -121,7 +121,7 @@ int main(int argc, char **argv)
 		strncpy(sslprm.cipher_list, "ALL:!MD5:@STRENGTH", MAX_FILENAME_LENGTH - 1);
 	if (sslprm.ssl_min_ver == SSL_Ver_Invalid)
 		sslprm.ssl_min_ver = TLSv1_plus;
-	if (sslprm.allowDH = -1)
+	if (sslprm.allowDH == -1)
 		sslprm.allowDH = TRUE;
 
 	generate_crc32_table();		/* generate the CRC 32 table */

+ 2 - 7
startup/mac-org.plist.in

@@ -12,9 +12,10 @@
 	<string>@sbindir@/nrpe</string>
 	<key>ProgramArguments</key>
 	<array>
+		<string>nrpe</string>
 		<string>-c</string>
 		<string>@pkgsysconfdir@/nrpe.cfg</string>
-		<string>-i</string>
+		<string>-f</string>
 	</array>
 	<key>KeepAlive</key>
 	<dict>
@@ -25,13 +26,7 @@
 	</dict>
 	<key>RunAtLoad</key>
 	<true/>
-	<!-- ExitTimeOut would be for nagios itself, not nrpe -->
-	<key>ExitTimeOut</key>
-	<integer>120</integer>
 	<key>ProcessType</key>
 	<string>Background</string>
-	<!-- LaunchOnlyOnce might be for nagios checkconfig -->
-	<key>LaunchOnlyOnce</key>
-	<false/>
 </dict>
 </plist>