#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>
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 */
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 */
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 */
#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>
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 */
#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>
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
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
/* 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( );
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( );
/* 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 */
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 */
* (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".
*/
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() */