static char Conf_MotdFile[FNAME_LEN];
static void Set_Defaults PARAMS(( bool InitServers ));
-static bool Read_Config PARAMS(( bool ngircd_starting ));
+static bool Read_Config PARAMS(( bool TestOnly, bool IsStarting ));
static bool Validate_Config PARAMS(( bool TestOnly, bool Rehash ));
static void Handle_GLOBAL PARAMS(( int Line, char *Var, char *Arg ));
GLOBAL void
Conf_Init( void )
{
- Read_Config( true );
+ Read_Config(false, true);
Validate_Config(false, false);
}
GLOBAL bool
Conf_Rehash( void )
{
- if (!Read_Config(false))
+ if (!Read_Config(false, false))
return false;
Validate_Config(false, true);
Use_Log = false;
- if (! Read_Config(true))
+ if (!Read_Config(true, true))
return 1;
config_valid = Validate_Config(true, false);
* successfully; false otherwise.
*/
static bool
-Read_Config( bool ngircd_starting )
+Read_Config(bool TestOnly, bool IsStarting)
{
char section[LINE_LEN], str[LINE_LEN], *var, *arg, *ptr;
const UINT16 defaultport = 6667;
/* No configuration file found! */
Config_Error( LOG_ALERT, "Can't read configuration \"%s\": %s",
NGIRCd_ConfFile, strerror( errno ));
- if (!ngircd_starting)
+ if (!IsStarting)
return false;
Config_Error( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
exit( 1 );
}
opers_free();
- Set_Defaults( ngircd_starting );
+ Set_Defaults(IsStarting);
- Config_Error( LOG_INFO, "Reading configuration from \"%s\" ...", NGIRCd_ConfFile );
+ if (TestOnly)
+ Config_Error(LOG_INFO,
+ "Reading configuration from \"%s\" ...",
+ NGIRCd_ConfFile );
/* Clean up server configuration structure: mark all already
* configured servers as "once" so that they are deleted
#ifndef LOG_CONS /* Kludge: mips-dec-ultrix4.5 has no LOG_CONS */
#define LOG_CONS 0
#endif
- openlog(PACKAGE_NAME, LOG_CONS|LOG_PID, Conf_SyslogFacility);
+#ifdef LOG_DAEMON
+ openlog(PACKAGE_NAME, LOG_CONS|LOG_PID, LOG_DAEMON);
+#else
+ openlog(PACKAGE_NAME, LOG_CONS|LOG_PID, 0);
+#endif
#endif
-
- Log(LOG_NOTICE, "%s started.", NGIRCd_Version);
} /* Log_Init */
openlog(PACKAGE_NAME, LOG_CONS|LOG_PID, Conf_SyslogFacility);
#endif
Log(LOG_NOTICE, "%s started.", NGIRCd_Version);
+ Log(LOG_INFO, "Using configuration file \"%s\" ...", NGIRCd_ConfFile);
}