| 29 |
|
#include "channel.h" |
| 30 |
|
#include "channel_mode.h" |
| 31 |
|
#include "client.h" |
| 32 |
– |
#include "common.h" |
| 32 |
|
#include "event.h" |
| 33 |
|
#include "fdlist.h" |
| 34 |
|
#include "hash.h" |
| 36 |
|
#include "ircd_signal.h" |
| 37 |
|
#include "s_gline.h" |
| 38 |
|
#include "motd.h" |
| 40 |
– |
#include "ircd_handler.h" |
| 41 |
– |
#include "msg.h" /* msgtab */ |
| 39 |
|
#include "hostmask.h" |
| 40 |
|
#include "numeric.h" |
| 41 |
|
#include "packet.h" |
| 72 |
|
struct admin_info AdminInfo = { NULL, NULL, NULL }; |
| 73 |
|
struct Counter Count = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
| 74 |
|
struct ServerState_t server_state = { 0 }; |
| 75 |
< |
struct logging_entry ConfigLoggingEntry = { 1, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0} }; |
| 75 |
> |
struct logging_entry ConfigLoggingEntry = { 1, 1 }; |
| 76 |
|
struct ServerStatistics ServerStats; |
| 77 |
|
struct timeval SystemTime; |
| 78 |
|
struct Client me; /* That's me */ |
| 178 |
|
|
| 179 |
|
if (gettimeofday(&newtime, NULL) == -1) |
| 180 |
|
{ |
| 181 |
< |
ilog(L_ERROR, "Clock Failure (%s), TS can be corrupted", |
| 181 |
> |
ilog(LOG_TYPE_IRCD, "Clock Failure (%s), TS can be corrupted", |
| 182 |
|
strerror(errno)); |
| 183 |
|
sendto_realops_flags(UMODE_ALL, L_ALL, |
| 184 |
|
"Clock Failure (%s), TS can be corrupted", |
| 351 |
|
size_t nbytes = snprintf(buff, sizeof(buff), "%u\n", pid); |
| 352 |
|
|
| 353 |
|
if ((fbputs(buff, fb, nbytes) == -1)) |
| 354 |
< |
ilog(L_ERROR, "Error writing %u to pid file %s (%s)", |
| 354 |
> |
ilog(LOG_TYPE_IRCD, "Error writing %u to pid file %s (%s)", |
| 355 |
|
pid, filename, strerror(errno)); |
| 356 |
|
|
| 357 |
|
fbclose(fb); |
| 359 |
|
} |
| 360 |
|
else |
| 361 |
|
{ |
| 362 |
< |
ilog(L_ERROR, "Error opening pid file %s", filename); |
| 362 |
> |
ilog(LOG_TYPE_IRCD, "Error opening pid file %s", filename); |
| 363 |
|
} |
| 364 |
|
} |
| 365 |
|
|
| 448 |
|
|
| 449 |
|
fprintf(stderr, "ERROR: Could not initialize the SSL context -- %s\n", |
| 450 |
|
s = ERR_lib_error_string(ERR_get_error())); |
| 451 |
< |
ilog(L_CRIT, "ERROR: Could not initialize the SSL context -- %s\n", s); |
| 451 |
> |
ilog(LOG_TYPE_IRCD, "ERROR: Could not initialize the SSL context -- %s\n", s); |
| 452 |
|
} |
| 453 |
|
|
| 454 |
|
SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv2); |
| 546 |
|
eventInit(); |
| 547 |
|
/* We need this to initialise the fd array before anything else */ |
| 548 |
|
fdlist_init(); |
| 549 |
< |
init_log(logFileName); |
| 549 |
> |
log_add_file(LOG_TYPE_IRCD, 0, logFileName); |
| 550 |
|
check_can_use_v6(); |
| 551 |
|
init_comm(); /* This needs to be setup early ! -- adrian */ |
| 552 |
|
/* Check if there is pidfile and daemon already running */ |
| 575 |
|
|
| 576 |
|
if (EmptyString(ServerInfo.sid)) |
| 577 |
|
{ |
| 578 |
< |
ilog(L_CRIT, "ERROR: No server id specified in serverinfo block."); |
| 578 |
> |
ilog(LOG_TYPE_IRCD, "ERROR: No server id specified in serverinfo block."); |
| 579 |
|
exit(EXIT_FAILURE); |
| 580 |
|
} |
| 581 |
|
|
| 583 |
|
|
| 584 |
|
if (EmptyString(ServerInfo.name)) |
| 585 |
|
{ |
| 586 |
< |
ilog(L_CRIT, "ERROR: No server name specified in serverinfo block."); |
| 586 |
> |
ilog(LOG_TYPE_IRCD, "ERROR: No server name specified in serverinfo block."); |
| 587 |
|
exit(EXIT_FAILURE); |
| 588 |
|
} |
| 589 |
|
|
| 592 |
|
/* serverinfo{} description must exist. If not, error out.*/ |
| 593 |
|
if (EmptyString(ServerInfo.description)) |
| 594 |
|
{ |
| 595 |
< |
ilog(L_CRIT, "ERROR: No server description specified in serverinfo block."); |
| 595 |
> |
ilog(LOG_TYPE_IRCD, "ERROR: No server description specified in serverinfo block."); |
| 596 |
|
exit(EXIT_FAILURE); |
| 597 |
|
} |
| 598 |
|
|
| 615 |
|
|
| 616 |
|
if (chdir(MODPATH)) |
| 617 |
|
{ |
| 618 |
< |
ilog(L_CRIT, "Could not load core modules. Terminating!"); |
| 618 |
> |
ilog(LOG_TYPE_IRCD, "Could not load core modules. Terminating!"); |
| 619 |
|
exit(EXIT_FAILURE); |
| 620 |
|
} |
| 621 |
|
|
| 638 |
|
|
| 639 |
|
write_pidfile(pidFileName); |
| 640 |
|
|
| 641 |
< |
ilog(L_NOTICE, "Server Ready"); |
| 641 |
> |
ilog(LOG_TYPE_IRCD, "Server Ready"); |
| 642 |
|
|
| 643 |
|
eventAddIsh("cleanup_glines", cleanup_glines, NULL, CLEANUP_GLINES_TIME); |
| 644 |
|
eventAddIsh("cleanup_tklines", cleanup_tklines, NULL, CLEANUP_TKLINES_TIME); |