diff -Naur nrpe/src/nrpe.c nrpe-patched/src/nrpe.c
--- nrpe/src/nrpe.c	2008-01-24 05:45:16.000000000 -0700
+++ nrpe-patched/src/nrpe.c	2008-02-02 10:05:12.000000000 -0700
@@ -79,7 +79,11 @@
 int     use_inetd=TRUE;
 int     debug=FALSE;
 
+#ifdef _AIX
+int	use_aix_src=FALSE;
+#endif
 
+static int wc_wrapper(void);
 
 
 int main(int argc, char **argv){
@@ -267,6 +271,20 @@
 		handle_connection(0);
 	        }
 
+#ifdef _AIX
+	/* else if running under AIX System Resource Controller (SRC),
+ 		just start listening for requests... */
+	else if (use_aix_src == TRUE) {
+
+		/* make sure we're not root */
+		check_privileges();
+
+		/* wait for connections */
+		if ((result = wc_wrapper()) != OK)
+			return result;
+		}
+#endif
+
 	/* else daemonize and start listening for requests... */
 	else if(fork()==0){
 		
@@ -304,31 +322,9 @@
 		/* make sure we're not root */
 		check_privileges();
 
-		do{
-
-			/* reset flags */
-			sigrestart=FALSE;
-			sigshutdown=FALSE;
-
-			/* wait for connections */
-			wait_for_connections();
-
-			/* free all memory we allocated */
-			free_memory();
-
-			if(sigrestart==TRUE){
-
-				/* read the config file */
-				result=read_config_file(config_file);	
-
-				/* exit if there are errors... */
-				if(result==ERROR){
-					syslog(LOG_ERR,"Config file '%s' contained errors, bailing out...",config_file);
-					return STATE_CRITICAL;
-				        }
-			        }
-	
-		        }while(sigrestart==TRUE && sigshutdown==FALSE);
+		/* wait for connections */
+		if ((result = wc_wrapper()) != OK)
+			return result;
 
 		/* remove pid file */
 		remove_pid_file();
@@ -348,6 +344,40 @@
 
 
 
+static int wc_wrapper(void){
+	int result;
+
+	do{
+
+		/* reset flags */
+		sigrestart=FALSE;
+		sigshutdown=FALSE;
+
+		/* wait for connections */
+		wait_for_connections();
+
+		/* free all memory we allocated */
+		free_memory();
+
+		if(sigrestart==TRUE){
+
+			/* read the config file */
+			result=read_config_file(config_file);	
+
+			/* exit if there are errors... */
+			if(result==ERROR){
+				syslog(LOG_ERR,"Config file '%s' contained errors, bailing out...",config_file);
+				return STATE_CRITICAL;
+				}
+			}
+
+		}while(sigrestart==TRUE && sigshutdown==FALSE);
+
+		return OK;
+	}
+
+
+
 
 /* read in the configuration file */
 int read_config_file(char *filename){
@@ -1903,6 +1933,9 @@
 		{"config", required_argument, 0, 'c'},
 		{"inetd", no_argument, 0, 'i'},
 		{"daemon", no_argument, 0, 'd'},
+#ifdef _AIX
+		{"aix-src", no_argument, 0, 'S'},
+#endif
 		{"no-ssl", no_argument, 0, 'n'},
 		{"help", no_argument, 0, 'h'},
 		{"license", no_argument, 0, 'l'},
@@ -1914,7 +1947,13 @@
 	if(argc<2)
 		return ERROR;
 
-	snprintf(optchars,MAX_INPUT_BUFFER,"c:hVldin");
+#ifdef _AIX
+# define OPTCHARS "c:hVldinS"
+#else
+# define OPTCHARS "c:hVldin"
+#endif
+
+	snprintf(optchars,MAX_INPUT_BUFFER,OPTCHARS);
 
 	while(1){
 #ifdef HAVE_GETOPT_LONG
@@ -1953,6 +1992,11 @@
 		case 'n':
 			use_ssl=FALSE;
 			break;
+#ifdef _AIX
+		case 'S':
+			use_aix_src=TRUE;
+			break;
+#endif
 		default:
 			return ERROR;
 			break;
