[Pkg-nagios-changes] nsca/src nsca.c, 1.1.1.1, 1.2 send_nsca.c, 1.1.1.1, 1.2

seanius at haydn.debian.org seanius at haydn.debian.org
Mon Dec 5 10:51:03 UTC 2005


Update of /cvsroot/pkg-nagios/nsca/src
In directory haydn:/org/alioth.debian.org/chroot/home/users/seanius/tmp/cvs-serv2349/src

Modified Files:
	nsca.c send_nsca.c 
Log Message:
ready for next upload

Index: nsca.c
===================================================================
RCS file: /cvsroot/pkg-nagios/nsca/src/nsca.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- nsca.c	24 Jul 2003 00:08:36 -0000	1.1.1.1
+++ nsca.c	5 Dec 2005 10:51:00 -0000	1.2
@@ -60,6 +60,8 @@
 int show_license=FALSE;
 int show_version=FALSE;
 
+int foreground=FALSE;
+
 static FILE *command_file_fp=NULL;
 
 struct handler_entry{
@@ -109,10 +111,11 @@
 	        }
 
 	if(result!=OK || show_help==TRUE){
-                printf("Usage: %s -c <config_file> [mode]\n",argv[0]);
+                printf("Usage: %s -c <config_file> [-f] [mode]\n",argv[0]);
                 printf("\n");
                 printf("Options:\n");
 		printf(" <config_file> = Name of config file to use\n");
+		printf(" [-f]        = run in the foreground, do not fork\n");
 		printf(" [mode]        = Determines how NSCA should run. Valid modes:\n");
                 printf("   --inetd     = Run as a service under inetd or xinetd\n");
                 printf("   --daemon    = Run as a standalone multi-process daemon\n");
@@ -182,7 +185,7 @@
 
         case SINGLE_PROCESS_DAEMON:
                 /* daemonize and start listening for requests... */
-                if(fork()==0){
+                if(foreground || fork()==0){
 
                         /* we're a daemon - set up a new process group */
                         setsid();
@@ -1121,6 +1124,10 @@
 		else if(!strcmp(argv[x-1],"-V") || !strcmp(argv[x-1],"--version"))
 			show_version=TRUE;
 
+		/* run in the foreground */
+		else if(!strcmp(argv[x-1],"-f"))
+			foreground=TRUE;
+
 		else if(!strcmp(argv[x-1],"-d") || !strcmp(argv[x-1],"--daemon"))
                         mode=MULTI_PROCESS_DAEMON;
 

Index: send_nsca.c
===================================================================
RCS file: /cvsroot/pkg-nagios/nsca/src/send_nsca.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- send_nsca.c	24 Jul 2003 00:08:36 -0000	1.1.1.1
+++ send_nsca.c	5 Dec 2005 10:51:00 -0000	1.2
@@ -25,7 +25,7 @@
 int server_port=DEFAULT_SERVER_PORT;
 char server_name[MAX_HOST_ADDRESS_LENGTH];
 char password[MAX_INPUT_BUFFER]="";
-char config_file[MAX_INPUT_BUFFER]="send_nsca.cfg";
+char config_file[MAX_INPUT_BUFFER]="/etc/send_nsca.cfg";
 char delimiter[2]="\t";
 
 char received_iv[TRANSMITTED_IV_SIZE];




More information about the Pkg-nagios-changes mailing list