CVS User Account cvsuser
Mon Sep 26 08:42:35 PDT 2005
Log Message:
-----------
Per discussion with Dave, this patch adds some logging to the slon
startup to indicate when it's running with no engines (or which engines
it's running with). It also adds information about the required restart
after adding or removing an engine. [Magnus Hagander]

Modified Files:
--------------
    slony1-engine/src/slon/port:
        win32service.c (r1.5 -> r1.6)

-------------- next part --------------
Index: win32service.c
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slon/port/win32service.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -Lsrc/slon/port/win32service.c -Lsrc/slon/port/win32service.c -u -w -r1.5 -r1.6
--- src/slon/port/win32service.c
+++ src/slon/port/win32service.c
@@ -79,6 +79,7 @@
 	DWORD ret;
 	HANDLE *waithandles = NULL;
 	int i;
+	int startcount;
 
 	/* fetch our actual service name */
 	strcpy(running_servicename, argv[0]);
@@ -130,6 +131,7 @@
 	waithandles[0] = shutdownEvent;
 	
 	/* Start the required slony processes */
+	startcount = 0;
 	for (i = 0; i < childcount; i++)
 	{
 		waithandles[i+1] = win32_start_engine(i);
@@ -138,7 +140,10 @@
 		   prevent failure in wait code */
 		if (waithandles[i+1] == INVALID_HANDLE_VALUE)
 			waithandles[i+1] = shutdownEvent;
+        else
+            startcount++;
 	}
+	slon_log(SLON_INFO, "started %i slon engine(s)", startcount);
 
 	/* Stay in a loop until SCM shuts us down */ 
 	while (true)
@@ -353,6 +358,7 @@
 		CloseHandle(pi.hProcess);
 		return INVALID_HANDLE_VALUE;
 	}
+	slon_log(SLON_INFO,"Started Slon engine for '%s' with pid %i", children_config_files[num], pi.dwProcessId);
 }
 
 
@@ -602,6 +608,7 @@
 	if (r == ERROR_SUCCESS)
 	{
 		printf("Engine added.\n");
+		printf("NOTE! You need to restart the Slony service before this takes effect.\n");
 		return;
 	}
 	else
@@ -625,6 +632,7 @@
 	if (r == ERROR_SUCCESS)
 	{
 		printf("Engine removed.\n");
+		printf("NOTE! You need to restart the Slony service before this takes effect.\n");
 		return;
 	}
 	else if (r == 2)


More information about the Slony1-commit mailing list