added some more descriptive logging. removed old signal handling code. no longer...
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 29 May 2007 12:54:49 +0000 (12:54 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 29 May 2007 12:54:49 +0000 (12:54 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@924 9efc2488-bf62-4759-914b-345cdb29e865

src/libstack/osrf_system.c

index a9f793e..2cda339 100644 (file)
@@ -3,7 +3,6 @@
 #include "osrf_application.h"
 #include "osrf_prefork.h"
 
-static void osrfSystemSignalHandler( int sig );
 static int _osrfSystemInitCache( void );
 
 static transport_client* osrfGlobalTransportClient = NULL;
@@ -129,20 +128,20 @@ int osrfSystemBootstrap( char* hostname, char* configfile, char* contextNode ) {
 
        /* background and let our children do their thing */
        daemonize();
-       while(1) {
-               errno = 0;
-               pid_t pid = wait( NULL );
-               if ( -1 == pid ) {
-                       if ( errno != ECHILD ) {
-                               char* err_str = strerror( errno );
-                               osrfLogWarning( OSRF_LOG_MARK, "Exiting on singal or error: %s\n", err_str );
-                               free(err_str);
-                       }
-                       break;
-               } else {
-                       osrfLogWarning( OSRF_LOG_MARK, "We lost child %d", pid);
-               }
-       }
+    while(1) {
+        errno = 0;
+        pid_t pid = wait(NULL);
+        if(-1 == pid) {
+            if(errno == ECHILD)
+                osrfLogError(OSRF_LOG_MARK, "We have no more live services... exiting");
+            else
+                osrfLogError(OSRF_LOG_MARK, "Exiting top-level system loop with error: %s", strerror(errno));
+            break;
+        } else {
+            osrfLogError(OSRF_LOG_MARK, "We lost a top-level service process with PID %d", pid);
+        }
+    }
+
 
        return 0;
 }
@@ -316,16 +315,3 @@ int osrf_system_shutdown( void ) {
 
 
 
-static void osrfSystemSignalHandler( int sig ) {
-
-       pid_t pid;
-       int status;
-
-       while( (pid = waitpid(-1, &status, WNOHANG)) > 0) {
-               osrfLogWarning( OSRF_LOG_MARK, "We lost child %d", pid);
-       }
-
-       /** relaunch the server **/
-}
-
-