Commit Diff


commit - 1df4081e504ab9da75ed30526c728329a4d83c64
commit + 43a4bc5b8bb064e2dfca456ab6fcc656b4dfa813
blob - 7e50b653cc5df09f7b06d449cc97a32de95b66c5
blob + 2a63ea59e9eb78067b580f5490968d78fd8934be
--- src/ngircd/irc-oper.c
+++ src/ngircd/irc-oper.c
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc-oper.c,v 1.13 2002/12/12 12:33:14 alex Exp $";
+static char UNUSED id[] = "$Id: irc-oper.c,v 1.14 2002/12/19 04:30:00 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -90,8 +90,8 @@ IRC_DIE( CLIENT *Client, REQUEST *Req )
 
 	if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
 
-	Log( LOG_NOTICE|LOG_snotice, "Got DIE command from \"%s\", going down!", Client_Mask( Client ));
-	NGIRCd_Quit = TRUE;
+	Log( LOG_NOTICE|LOG_snotice, "Got DIE command from \"%s\", shutdown triggered!", Client_Mask( Client ));
+	NGIRCd_SignalQuit = TRUE;
 	return CONNECTED;
 } /* IRC_DIE */
 
@@ -107,8 +107,8 @@ IRC_REHASH( CLIENT *Client, REQUEST *Req )
 
 	if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
 
-	Log( LOG_NOTICE|LOG_snotice, "Got REHASH command from \"%s\", re-reading configuration ...", Client_Mask( Client ));
-	NGIRCd_Rehash( );
+	Log( LOG_NOTICE|LOG_snotice, "Got REHASH command from \"%s\", reload of configuration triggered.", Client_Mask( Client ));
+	NGIRCd_SignalRehash = TRUE;
 	
 	return CONNECTED;
 } /* IRC_REHASH */
@@ -125,8 +125,8 @@ IRC_RESTART( CLIENT *Client, REQUEST *Req )
 
 	if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
 
-	Log( LOG_NOTICE|LOG_snotice, "Got RESTART command from \"%s\", going down!", Client_Mask( Client ));
-	NGIRCd_Restart = TRUE;
+	Log( LOG_NOTICE|LOG_snotice, "Got RESTART command from \"%s\", shutdown triggered!", Client_Mask( Client ));
+	NGIRCd_SignalRestart = TRUE;
 	return CONNECTED;
 } /* IRC_RESTART */
 
blob - 79f3c6fef7b9234506210fdb499b27e2b2dfd6a7
blob + db0f076795c4c2f485533b6b7cf5633363c4b2ae
--- src/ngircd/log.c
+++ src/ngircd/log.c
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: log.c,v 1.41 2002/12/12 12:24:18 alex Exp $";
+static char UNUSED id[] = "$Id: log.c,v 1.42 2002/12/19 04:30:00 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -119,7 +119,7 @@ GLOBAL VOID
 Log_Exit( VOID )
 {
 	/* Good Bye! */
-	if( NGIRCd_Restart ) Log( LOG_NOTICE, "%s done (restarting).", PACKAGE );
+	if( NGIRCd_SignalRestart ) Log( LOG_NOTICE, "%s done (restarting).", PACKAGE );
 	else Log( LOG_NOTICE, "%s done.", PACKAGE );
 
 	/* Error-File (stderr) loeschen */
blob - 1396d9ed706f08da5e5cba9eaf1087f07e1272be
blob + 20db13ed94c96a5bb2a4e02df2e398c5e37f3751
--- src/ngircd/ngircd.c
+++ src/ngircd/ngircd.c
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: ngircd.c,v 1.64 2002/12/12 11:31:21 alex Exp $";
+static char UNUSED id[] = "$Id: ngircd.c,v 1.65 2002/12/19 04:29:59 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -65,10 +65,8 @@ main( int argc, const char *argv[] )
 
 	umask( 0077 );
 
-	NGIRCd_Restart = FALSE;
-	NGIRCd_Quit = FALSE;
-	NGIRCd_NoDaemon = FALSE;
-	NGIRCd_Passive = FALSE;
+	NGIRCd_SignalQuit = NGIRCd_SignalRestart = NGIRCd_SignalRehash = FALSE;
+	NGIRCd_NoDaemon = NGIRCd_Passive = FALSE;
 #ifdef DEBUG
 	NGIRCd_Debug = FALSE;
 #endif
@@ -220,7 +218,7 @@ main( int argc, const char *argv[] )
 		exit( Conf_Test( ));
 	}
 	
-	while( ! NGIRCd_Quit )
+	while( ! NGIRCd_SignalQuit )
 	{
 		/* In der Regel wird ein Sub-Prozess ge-fork()'t, der
 		 * nicht mehr mit dem Terminal verbunden ist. Mit der
@@ -250,8 +248,9 @@ main( int argc, const char *argv[] )
 		/* Globale Variablen initialisieren */
 		NGIRCd_Start = time( NULL );
 		(VOID)strftime( NGIRCd_StartStr, 64, "%a %b %d %Y at %H:%M:%S (%Z)", localtime( &NGIRCd_Start ));
-		NGIRCd_Restart = FALSE;
-		NGIRCd_Quit = FALSE;
+		NGIRCd_SignalRehash = FALSE;
+		NGIRCd_SignalRestart = FALSE;
+		NGIRCd_SignalQuit = FALSE;
 
 		/* Module initialisieren */
 		Log_Init( );
@@ -393,7 +392,10 @@ GLOBAL VOID
 NGIRCd_Rehash( VOID )
 {
 	CHAR old_name[CLIENT_ID_LEN];
-	
+
+	Log( LOG_NOTICE|LOG_snotice, "Re-reading configuration NOW!" );
+	NGIRCd_SignalRehash = FALSE;
+
 	/* Alle Listen-Sockets schliessen */
 	Conn_ExitListeners( );
 
@@ -417,7 +419,7 @@ NGIRCd_Rehash( VOID )
 	/* Listen-Sockets neu anlegen: */
 	Conn_InitListeners( );
 
-	Log( LOG_INFO, "Re-reading of configuration done." );
+	Log( LOG_NOTICE|LOG_snotice, "Re-reading of configuration done." );
 } /* NGIRCd_Rehash */
 
 
@@ -481,23 +483,21 @@ Signal_Handler( INT Signal )
 		case SIGINT:
 		case SIGQUIT:
 			/* wir soll(t)en uns wohl beenden ... */
-			if( Signal == SIGTERM ) Log( LOG_WARNING|LOG_snotice, "Got TERM signal, terminating now ..." );
-			else if( Signal == SIGINT ) Log( LOG_WARNING|LOG_snotice, "Got INT signal, terminating now ..." );
-			else if( Signal == SIGQUIT ) Log( LOG_WARNING|LOG_snotice, "Got QUIT signal, terminating now ..." );
-			NGIRCd_Quit = TRUE;
+			NGIRCd_SignalQuit = TRUE;
 			break;
 		case SIGHUP:
 			/* Konfiguration neu einlesen: */
-			Log( LOG_WARNING|LOG_snotice, "Got HUP signal, re-reading configuration ..." );
-			NGIRCd_Rehash( );
+			NGIRCd_SignalRehash = TRUE;
 			break;
 		case SIGCHLD:
 			/* Child-Prozess wurde beendet. Zombies vermeiden: */
 			while( waitpid( -1, NULL, WNOHANG ) > 0);
 			break;
+#ifdef DEBUG
 		default:
 			/* unbekanntes bzw. unbehandeltes Signal */
-			Log( LOG_NOTICE, "Got signal %d! Ignored.", Signal );
+			Log( LOG_DEBUG, "Got signal %d! Ignored.", Signal );
+#endif
 	}
 } /* Signal_Handler */
 
blob - 92d074b3c3e7de18ff542eef5ff5b7e2cc55bc5a
blob + a9fd1514fecd511813fd0b7aa54b478c76c44d79
--- src/ngircd/ngircd.h
+++ src/ngircd/ngircd.h
@@ -8,7 +8,7 @@
  * (at your option) any later version.
  * Please read the file COPYING, README and AUTHORS for more information.
  *
- * $Id: ngircd.h,v 1.17 2002/12/12 11:30:23 alex Exp $
+ * $Id: ngircd.h,v 1.18 2002/12/19 04:30:00 alex Exp $
  *
  * Prototypes of the "main module".
  */
@@ -37,8 +37,9 @@ GLOBAL BOOLEAN NGIRCd_NoDaemon;		/* nicht im Hintergru
 
 GLOBAL BOOLEAN NGIRCd_Passive;		/* nicht zu anderen Servern connecten */
 
-GLOBAL BOOLEAN NGIRCd_Quit;		/* TRUE: ngIRCd beenden */
-GLOBAL BOOLEAN NGIRCd_Restart;		/* TRUE: neu starten */
+GLOBAL BOOLEAN NGIRCd_SignalQuit;	/* TRUE: quit server*/
+GLOBAL BOOLEAN NGIRCd_SignalRestart;	/* TRUE: restart server */
+GLOBAL BOOLEAN NGIRCd_SignalRehash;	/* TRUE: reload configuration */
 
 GLOBAL CHAR NGIRCd_DebugLevel[2];	/* Debug-Level fuer IRC_VERSION() */