ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/src/ircd.c
(Generate patch)

Comparing:
ircd-hybrid/src/ircd.c (file contents), Revision 31 by knight, Sun Oct 2 20:34:05 2005 UTC vs.
ircd-hybrid/trunk/src/ircd.c (file contents), Revision 2156 by michael, Fri May 31 20:53:11 2013 UTC

# Line 24 | Line 24
24  
25   #include "stdinc.h"
26   #include "s_user.h"
27 < #include "tools.h"
27 > #include "list.h"
28   #include "ircd.h"
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"
35   #include "irc_string.h"
37 #include "sprintf_irc.h"
36   #include "ircd_signal.h"
39 #include "list.h"
37   #include "s_gline.h"
38   #include "motd.h"
39 < #include "ircd_handler.h"
43 < #include "msg.h"         /* msgtab */
39 > #include "conf.h"
40   #include "hostmask.h"
41   #include "numeric.h"
42   #include "packet.h"
43   #include "parse.h"
44   #include "irc_res.h"
45   #include "restart.h"
46 + #include "rng_mt.h"
47   #include "s_auth.h"
48   #include "s_bsd.h"
49 < #include "s_conf.h"
53 < #include "s_log.h"
49 > #include "log.h"
50   #include "s_misc.h"
51   #include "s_serv.h"      /* try_connections */
56 #include "s_stats.h"
52   #include "send.h"
53   #include "whowas.h"
54   #include "modules.h"
55   #include "memory.h"
56 + #include "mempool.h"
57   #include "hook.h"
58   #include "ircd_getopt.h"
59 < #include "balloc.h"
64 < #include "motd.h"
59 > #include "message.h"
60   #include "supported.h"
61 + #include "watch.h"
62 + #include "conf_db.h"
63 + #include "conf_class.h"
64  
67 /* Try and find the correct name to use with getrlimit() for setting the max.
68 * number of files allowed to be open by this process.
69 */
65  
66 + #ifdef HAVE_LIBGEOIP
67 + GeoIP *geoip_ctx;
68 + #endif
69   /* /quote set variables */
70   struct SetOptions GlobalSetOptions;
71  
# Line 77 | Line 75 | struct config_file_entry ConfigFileEntry
75   struct server_info ServerInfo;
76   /* admin info set from ircd.conf */
77   struct admin_info AdminInfo = { NULL, NULL, NULL };
78 < struct Counter Count = { 0, 0, 0, 0, 0, 0, 0, 0 };
78 > struct Counter Count = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
79   struct ServerState_t server_state = { 0 };
80 < struct logging_entry ConfigLoggingEntry = { 1, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0} };
80 > struct logging_entry ConfigLoggingEntry = { .use_logging = 1 };
81 > struct ServerStatistics ServerStats;
82   struct timeval SystemTime;
83   struct Client me;             /* That's me */
84   struct LocalUser meLocalUser; /* That's also part of me */
86 unsigned long connect_id = 0; /* unique connect ID */
85  
88 static unsigned long initialVMTop = 0;   /* top of virtual memory at init */
86   const char *logFileName = LPATH;
87   const char *pidFileName = PPATH;
88  
89   char **myargv;
93 char ircd_platform[PLATFORMLEN];
90  
91   int dorehash = 0;
92   int doremotd = 0;
97 time_t nextconnect = 1;       /* time for next try_connections call */
93  
94   /* Set to zero because it should be initialized later using
95   * initialize_server_capabs
96   */
97   int default_server_capabs = 0;
98 <
99 < #ifdef HAVE_LIBCRYPTO
100 < int bio_spare_fd = -1;
106 < #endif
107 <
108 < int splitmode;
109 < int splitchecking;
110 < int split_users;
98 > unsigned int splitmode;
99 > unsigned int splitchecking;
100 > unsigned int split_users;
101   unsigned int split_servers;
102  
103   /* Do klines the same way hybrid-6 did them, i.e. at the
# Line 122 | Line 112 | unsigned int split_servers;
112  
113   int rehashed_klines = 0;
114  
125 /*
126 * get_vm_top - get the operating systems notion of the resident set size
127 */
128 #ifndef _WIN32
129 static unsigned long
130 get_vm_top(void)
131 {
132  /*
133   * NOTE: sbrk is not part of the ANSI C library or the POSIX.1 standard
134   * however it seems that everyone defines it. Calling sbrk with a 0
135   * argument will return a pointer to the top of the process virtual
136   * memory without changing the process size, so this call should be
137   * reasonably safe (sbrk returns the new value for the top of memory).
138   * This code relies on the notion that the address returned will be an
139   * offset from 0 (NULL), so the result of sbrk is cast to a size_t and
140   * returned. We really shouldn't be using it here but...
141   */
142
143  void *vptr = sbrk(0);
144  return((unsigned long)vptr);
145 }
115  
116   /*
117   * print_startup - print startup information
# Line 174 | Line 143 | make_daemon(void)
143  
144    setsid();
145   }
177 #endif
178
179 /*
180 * get_maxrss - get the operating systems notion of the resident set size
181 */
182 unsigned long
183 get_maxrss(void)
184 {
185 #ifdef _WIN32
186  return (0);   /* FIXME */
187 #else
188  return (get_vm_top() - initialVMTop);
189 #endif
190 }
146  
147   static int printVersion = 0;
148  
149 < struct lgetopt myopts[] = {
195 <  {"dlinefile",  &ConfigFileEntry.dlinefile,
196 <   STRING, "File to use for dline.conf"},
149 > static struct lgetopt myopts[] = {
150    {"configfile", &ConfigFileEntry.configfile,
151     STRING, "File to use for ircd.conf"},
152 +  {"glinefile",  &ConfigFileEntry.glinefile,
153 +   STRING, "File to use for gline database"},
154    {"klinefile",  &ConfigFileEntry.klinefile,
155 <   STRING, "File to use for kline.conf"},
155 >   STRING, "File to use for kline database"},
156 >  {"dlinefile",  &ConfigFileEntry.dlinefile,
157 >   STRING, "File to use for dline database"},
158    {"xlinefile",  &ConfigFileEntry.xlinefile,
159 <   STRING, "File to use for xline.conf"},
159 >   STRING, "File to use for xline database"},
160 >  {"resvfile",  &ConfigFileEntry.resvfile,
161 >   STRING, "File to use for resv database"},
162    {"logfile",    &logFileName,
163     STRING, "File to use for ircd.log"},
164    {"pidfile",    &pidFileName,
# Line 217 | Line 176 | set_time(void)
176   {
177    static char to_send[200];
178    struct timeval newtime;
220 #ifdef _WIN32
221  FILETIME ft;
222
223  GetSystemTimeAsFileTime(&ft);
224  if (ft.dwLowDateTime < 0xd53e8000)
225    ft.dwHighDateTime--;
226  ft.dwLowDateTime -= 0xd53e8000;
227  ft.dwHighDateTime -= 0x19db1de;
228
229  newtime.tv_sec  = (*(uint64_t *) &ft) / 10000000;
230  newtime.tv_usec = (*(uint64_t *) &ft) / 10 % 1000000;
231 #else
179    newtime.tv_sec  = 0;
180    newtime.tv_usec = 0;
181  
182    if (gettimeofday(&newtime, NULL) == -1)
183    {
184 <    ilog(L_ERROR, "Clock Failure (%s), TS can be corrupted",
184 >    ilog(LOG_TYPE_IRCD, "Clock Failure (%s), TS can be corrupted",
185           strerror(errno));
186 <    sendto_realops_flags(UMODE_ALL, L_ALL,
186 >    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
187                           "Clock Failure (%s), TS can be corrupted",
188                           strerror(errno));
189      restart("Clock Failure");
190    }
244 #endif
191  
192    if (newtime.tv_sec < CurrentTime)
193    {
194 <    ircsprintf(to_send, "System clock is running backwards - (%lu < %lu)",
195 <               (unsigned long)newtime.tv_sec, (unsigned long)CurrentTime);
194 >    snprintf(to_send, sizeof(to_send),
195 >             "System clock is running backwards - (%lu < %lu)",
196 >             (unsigned long)newtime.tv_sec, (unsigned long)CurrentTime);
197      report_error(L_ALL, to_send, me.name, 0);
198      set_back_events(CurrentTime - newtime.tv_sec);
199    }
# Line 281 | Line 228 | io_loop(void)
228        {
229          struct Client *client_p = ptr->data;
230          assert(client_p->localClient->list_task);
231 <        safe_list_channels(client_p, client_p->localClient->list_task, 0, 0);
231 >        safe_list_channels(client_p, client_p->localClient->list_task, 0);
232        }
233      }
234  
# Line 304 | Line 251 | io_loop(void)
251      }
252      if (doremotd)
253      {
254 <      read_message_file(&ConfigFileEntry.motd);
255 <      sendto_realops_flags(UMODE_ALL, L_ALL,
256 <                           "Got signal SIGUSR1, reloading ircd motd file");
254 >      motd_recache();
255 >      sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
256 >                           "Got signal SIGUSR1, reloading motd files");
257        doremotd = 0;
258      }
259    }
# Line 347 | Line 294 | initialize_global_set_options(void)
294    }
295  
296    GlobalSetOptions.ident_timeout = IDENT_TIMEOUT;
350  GlobalSetOptions.idletime = ConfigFileEntry.idletime;
297    /* End of global set options */
298   }
299  
# Line 360 | Line 306 | initialize_global_set_options(void)
306   static void
307   initialize_message_files(void)
308   {
363  init_message_file(USER_MOTD, MPATH, &ConfigFileEntry.motd);
364  init_message_file(OPER_MOTD, OPATH, &ConfigFileEntry.opermotd);
365  init_message_file(USER_LINKS, LIPATH, &ConfigFileEntry.linksfile);
366
367  read_message_file(&ConfigFileEntry.motd);
368  read_message_file(&ConfigFileEntry.opermotd);
369  read_message_file(&ConfigFileEntry.linksfile);
370
309    init_isupport();
310   }
311  
# Line 380 | Line 318 | static void
318   initialize_server_capabs(void)
319   {
320    add_capability("QS", CAP_QS, 1);
383  add_capability("LL", CAP_LL, 1);
321    add_capability("EOB", CAP_EOB, 1);
322 <  if (ServerInfo.sid != NULL)   /* only enable TS6 if we have an SID */
386 <    add_capability("TS6", CAP_TS6, 0);
387 <  add_capability("ZIP", CAP_ZIP, 0);
322 >  add_capability("TS6", CAP_TS6, 0);
323    add_capability("CLUSTER", CAP_CLUSTER, 1);
324 +  add_capability("SVS", CAP_SVS, 1);
325   #ifdef HALFOPS
326    add_capability("HOPS", CAP_HOPS, 1);
327   #endif
# Line 400 | Line 336 | initialize_server_capabs(void)
336   static void
337   write_pidfile(const char *filename)
338   {
339 <  FBFILE *fb;
339 >  FILE *fb;
340  
341 <  if ((fb = fbopen(filename, "w")))
341 >  if ((fb = fopen(filename, "w")))
342    {
343      char buff[32];
344      unsigned int pid = (unsigned int)getpid();
409    size_t nbytes = ircsprintf(buff, "%u\n", pid);
345  
346 <    if ((fbputs(buff, fb, nbytes) == -1))
347 <      ilog(L_ERROR, "Error writing %u to pid file %s (%s)",
346 >    snprintf(buff, sizeof(buff), "%u\n", pid);
347 >
348 >    if ((fputs(buff, fb) == -1))
349 >      ilog(LOG_TYPE_IRCD, "Error writing %u to pid file %s (%s)",
350             pid, filename, strerror(errno));
351  
352 <    fbclose(fb);
416 <    return;
352 >    fclose(fb);
353    }
354    else
355    {
356 <    ilog(L_ERROR, "Error opening pid file %s", filename);
356 >    ilog(LOG_TYPE_IRCD, "Error opening pid file %s", filename);
357    }
358   }
359  
# Line 432 | Line 368 | write_pidfile(const char *filename)
368   static void
369   check_pidfile(const char *filename)
370   {
371 < #ifndef _WIN32
436 <  FBFILE *fb;
371 >  FILE *fb;
372    char buff[32];
373    pid_t pidfromfile;
374  
375    /* Don't do logging here, since we don't have log() initialised */
376 <  if ((fb = fbopen(filename, "r")))
376 >  if ((fb = fopen(filename, "r")))
377    {
378 <    if (fbgets(buff, 20, fb) == NULL)
378 >    if (fgets(buff, 20, fb) == NULL)
379      {
380        /* log(L_ERROR, "Error reading from pid file %s (%s)", filename,
381         * strerror(errno));
# Line 458 | Line 393 | check_pidfile(const char *filename)
393        }
394      }
395  
396 <    fbclose(fb);
396 >    fclose(fb);
397    }
398    else if (errno != ENOENT)
399    {
400      /* log(L_ERROR, "Error opening pid file %s", filename); */
401    }
467 #endif
402   }
403  
404   /* setup_corefile()
# Line 496 | Line 430 | setup_corefile(void)
430   * side effects - setups SSL context.
431   */
432   static void
433 < init_ssl(void)
433 > ssl_init(void)
434   {
435   #ifdef HAVE_LIBCRYPTO
436    SSL_load_error_strings();
437    SSLeay_add_ssl_algorithms();
438  
439 <  ServerInfo.ctx = SSL_CTX_new(SSLv23_server_method());
506 <  if (!ServerInfo.ctx)
439 >  if ((ServerInfo.server_ctx = SSL_CTX_new(SSLv23_server_method())) == NULL)
440    {
441      const char *s;
442  
443 <    fprintf(stderr, "ERROR: Could not initialize the SSL context -- %s\n",
443 >    fprintf(stderr, "ERROR: Could not initialize the SSL Server context -- %s\n",
444              s = ERR_lib_error_string(ERR_get_error()));
445 <    ilog(L_CRIT, "ERROR: Could not initialize the SSL context -- %s\n", s);
445 >    ilog(LOG_TYPE_IRCD, "ERROR: Could not initialize the SSL Server context -- %s\n", s);
446    }
447  
448 <  SSL_CTX_set_options(ServerInfo.ctx, SSL_OP_NO_SSLv2);
449 <  SSL_CTX_set_options(ServerInfo.ctx, SSL_OP_TLS_ROLLBACK_BUG|SSL_OP_ALL);
450 <  SSL_CTX_set_verify(ServerInfo.ctx, SSL_VERIFY_NONE, NULL);
448 >  SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TLSv1);
449 >  SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_TLS_ROLLBACK_BUG|SSL_OP_ALL);
450 >  SSL_CTX_set_verify(ServerInfo.server_ctx, SSL_VERIFY_NONE, NULL);
451  
452 <  bio_spare_fd = save_spare_fd("SSL private key validation");
453 < #endif /* HAVE_LIBCRYPTO */
454 < }
452 >  if ((ServerInfo.client_ctx = SSL_CTX_new(SSLv23_client_method())) == NULL)
453 >  {
454 >    const char *s;
455  
456 < /* init_callbacks()
457 < *
458 < * inputs       - nothing
459 < * output       - nothing
460 < * side effects - setups standard hook points
461 < */
462 < static void
463 < init_callbacks(void)
464 < {
532 <  iorecv_cb = register_callback("iorecv", NULL);
533 <  iosend_cb = register_callback("iosend", NULL);
534 <  iorecvctrl_cb = register_callback("iorecvctrl", NULL);
535 <  iosendctrl_cb = register_callback("iosendctrl", NULL);
456 >    fprintf(stderr, "ERROR: Could not initialize the SSL Client context -- %s\n",
457 >            s = ERR_lib_error_string(ERR_get_error()));
458 >    ilog(LOG_TYPE_IRCD, "ERROR: Could not initialize the SSL Client context -- %s\n", s);
459 >  }
460 >
461 >  SSL_CTX_set_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TLSv1);
462 >  SSL_CTX_set_options(ServerInfo.client_ctx, SSL_OP_TLS_ROLLBACK_BUG|SSL_OP_ALL);
463 >  SSL_CTX_set_verify(ServerInfo.client_ctx, SSL_VERIFY_NONE, NULL);
464 > #endif /* HAVE_LIBCRYPTO */
465   }
466  
467   int
# Line 541 | Line 470 | main(int argc, char *argv[])
470    /* Check to see if the user is running
471     * us as root, which is a nono
472     */
544 #ifndef _WIN32
473    if (geteuid() == 0)
474    {
475      fprintf(stderr, "Don't run ircd as root!!!\n");
476 <    return(-1);
476 >    return -1;
477    }
478  
479    /* Setup corefile size immediately after boot -kre */
480    setup_corefile();
481  
554  /* set initialVMTop before we allocate any memory */
555  initialVMTop = get_vm_top();
556 #endif
557
482    /* save server boot time right away, so getrusage works correctly */
483    set_time();
484  
485 <    /* It ain't random, but it ought to be a little harder to guess */
486 <  srand(SystemTime.tv_sec ^ (SystemTime.tv_usec | (getpid() << 20)));
487 <  memset(&me, 0, sizeof(me));
564 <  memset(&meLocalUser, 0, sizeof(meLocalUser));
485 >  /* It ain't random, but it ought to be a little harder to guess */
486 >  init_genrand(SystemTime.tv_sec ^ (SystemTime.tv_usec | (getpid() << 20)));
487 >
488    me.localClient = &meLocalUser;
489    dlinkAdd(&me, &me.node, &global_client_list); /* Pointer to beginning
490                                                     of Client list */
568
569  memset(&ServerInfo, 0, sizeof(ServerInfo));
570
491    /* Initialise the channel capability usage counts... */
492    init_chcap_usage_counts();
493  
494    ConfigFileEntry.dpath      = DPATH;
495 <  ConfigFileEntry.configfile = CPATH;  /* Server configuration file */
496 <  ConfigFileEntry.klinefile  = KPATH;  /* Server kline file         */
497 <  ConfigFileEntry.xlinefile  = XPATH;  /* Server xline file         */
498 <  ConfigFileEntry.rxlinefile = RXPATH; /* Server regex xline file   */
499 <  ConfigFileEntry.rklinefile = RKPATH; /* Server regex kline file   */
500 <  ConfigFileEntry.dlinefile  = DLPATH; /* dline file                */
501 <  ConfigFileEntry.glinefile  = GPATH;  /* gline log file            */
582 <  ConfigFileEntry.cresvfile  = CRESVPATH; /* channel resv file      */
583 <  ConfigFileEntry.nresvfile  = NRESVPATH; /* nick resv file         */
495 >  ConfigFileEntry.configfile = CPATH;    /* Server configuration file */
496 >  ConfigFileEntry.klinefile  = KPATH;    /* Server kline file         */
497 >  ConfigFileEntry.glinefile  = GPATH;    /* Server gline file         */
498 >  ConfigFileEntry.xlinefile  = XPATH;    /* Server xline file         */
499 >  ConfigFileEntry.dlinefile  = DLPATH;   /* dline file                */
500 >  ConfigFileEntry.resvfile   = RESVPATH; /* resv file                 */
501 >
502    myargv = argv;
503    umask(077);                /* better safe than sorry --SRB */
504  
# Line 598 | Line 516 | main(int argc, char *argv[])
516      exit(EXIT_FAILURE);
517    }
518  
519 <  init_ssl();
519 >  ssl_init();
520  
603 #ifndef _WIN32
521    if (!server_state.foreground)
522    {
523      make_daemon();
# Line 610 | Line 527 | main(int argc, char *argv[])
527      print_startup(getpid());
528  
529    setup_signals();
613 #endif
614
615  get_ircd_platform(ircd_platform);
530  
531    /* Init the event subsystem */
532    eventInit();
533    /* We need this to initialise the fd array before anything else */
534    fdlist_init();
535 <  init_log(logFileName);
535 >  log_set_file(LOG_TYPE_IRCD, 0, logFileName);
536    check_can_use_v6();
537    init_comm();         /* This needs to be setup early ! -- adrian */
538    /* Check if there is pidfile and daemon already running */
539    check_pidfile(pidFileName);
540  
541 < #ifndef NOBALLOC
628 <  initBlockHeap();
629 < #endif
541 >  mp_pool_init();
542    init_dlink_nodes();
631  init_callbacks();
543    initialize_message_files();
544    dbuf_init();
545 <  init_hash();
545 >  hash_init();
546    init_ip_hash_table();      /* client host ip hash table */
547    init_host_hash();          /* Host-hashtable. */
548 <  clear_tree_parse();
549 <  init_client();
550 <  init_class();
551 <  init_whowas();
552 <  init_stats();
548 >  client_init();
549 >  class_init();
550 >  whowas_init();
551 >  watch_init();
552 >  auth_init();          /* Initialise the auth code */
553 >  init_resolver();      /* Needs to be setup before the io loop */
554 >  modules_init();
555    read_conf_files(1);   /* cold start init conf files */
643  initServerMask();
644  me.id[0] = '\0';
556    init_uid();
646  init_auth();          /* Initialise the auth code */
647 #ifndef _WIN32
648  init_resolver();      /* Needs to be setup before the io loop */
649 #endif
557    initialize_server_capabs();   /* Set up default_server_capabs */
558    initialize_global_set_options();
559 <  init_channels();
559 >  channel_init();
560 >  motd_init();
561 > #ifdef HAVE_LIBGEOIP
562 >  geoip_ctx = GeoIP_new(GEOIP_MEMORY_CACHE);
563 > #endif
564  
565 <  if (ServerInfo.name == NULL)
565 >  if (EmptyString(ServerInfo.sid))
566    {
567 <    ilog(L_CRIT, "No server name specified in serverinfo block.");
567 >    ilog(LOG_TYPE_IRCD, "ERROR: No server id specified in serverinfo block.");
568      exit(EXIT_FAILURE);
569    }
570 +
571 +  strlcpy(me.id, ServerInfo.sid, sizeof(me.id));
572 +
573 +  if (EmptyString(ServerInfo.name))
574 +  {
575 +    ilog(LOG_TYPE_IRCD, "ERROR: No server name specified in serverinfo block.");
576 +    exit(EXIT_FAILURE);
577 +  }
578 +
579    strlcpy(me.name, ServerInfo.name, sizeof(me.name));
580  
581    /* serverinfo{} description must exist.  If not, error out.*/
582 <  if (ServerInfo.description == NULL)
582 >  if (EmptyString(ServerInfo.description))
583    {
584 <    ilog(L_CRIT,
665 <      "ERROR: No server description specified in serverinfo block.");
584 >    ilog(LOG_TYPE_IRCD, "ERROR: No server description specified in serverinfo block.");
585      exit(EXIT_FAILURE);
586    }
587 +
588    strlcpy(me.info, ServerInfo.description, sizeof(me.info));
589  
590 <  me.from    = &me;
591 <  me.servptr = &me;
590 >  me.from                   = &me;
591 >  me.servptr                = &me;
592 >  me.localClient->lasttime  = CurrentTime;
593 >  me.localClient->since     = CurrentTime;
594 >  me.localClient->firsttime = CurrentTime;
595  
596    SetMe(&me);
597    make_server(&me);
598  
599 <  me.lasttime = me.since = me.firsttime = CurrentTime;
599 >  hash_add_id(&me);
600    hash_add_client(&me);
601    
602    /* add ourselves to global_serv_list */
603    dlinkAdd(&me, make_dlink_node(), &global_serv_list);
604  
605 <  check_class();
605 >  load_kline_database();
606 >  load_dline_database();
607 >  load_gline_database();
608 >  load_xline_database();
609 >  load_resv_database();
610  
684 #ifndef STATIC_MODULES
611    if (chdir(MODPATH))
612    {
613 <    ilog (L_CRIT, "Could not load core modules. Terminating!");
613 >    ilog(LOG_TYPE_IRCD, "Could not load core modules. Terminating!");
614      exit(EXIT_FAILURE);
615    }
616  
617    load_all_modules(1);
618    load_conf_modules();
619    load_core_modules(1);
620 +
621    /* Go back to DPATH after checking to see if we can chdir to MODPATH */
622 <  chdir(ConfigFileEntry.dpath);
623 < #else
624 <  load_all_modules(1);
625 < #endif
622 >  if (chdir(ConfigFileEntry.dpath))
623 >  {
624 >    perror("chdir");
625 >    exit(EXIT_FAILURE);
626 >  }
627 >
628    /*
629     * assemble_umode_buffer() has to be called after
630     * reading conf/loading modules.
# Line 704 | Line 633 | main(int argc, char *argv[])
633  
634    write_pidfile(pidFileName);
635  
636 <  ilog(L_NOTICE, "Server Ready");
636 >  ilog(LOG_TYPE_IRCD, "Server Ready");
637  
638    eventAddIsh("cleanup_glines", cleanup_glines, NULL, CLEANUP_GLINES_TIME);
639    eventAddIsh("cleanup_tklines", cleanup_tklines, NULL, CLEANUP_TKLINES_TIME);
# Line 713 | Line 642 | main(int argc, char *argv[])
642    /* No, 'cause after a restart it would cause all sorts of nick collides */
643    eventAddIsh("try_connections", try_connections, NULL, STARTUP_CONNECTIONS_TIME);
644  
716  eventAddIsh("collect_zipstats", collect_zipstats, NULL, ZIPSTATS_TIME);
717
645    /* Setup the timeout check. I'll shift it later :)  -- adrian */
646    eventAddIsh("comm_checktimeouts", comm_checktimeouts, NULL, 1);
647  
648 +  eventAddIsh("save_all_databases", save_all_databases, NULL, DATABASE_UPDATE_TIMEOUT);
649 +
650    if (ConfigServerHide.links_delay > 0)
651      eventAddIsh("write_links_file", write_links_file, NULL, ConfigServerHide.links_delay);
652    else
# Line 727 | Line 656 | main(int argc, char *argv[])
656      eventAddIsh("check_splitmode", check_splitmode, NULL, 60);
657  
658    io_loop();
659 <  return(0);
659 >  return 0;
660   }

Comparing:
ircd-hybrid/src/ircd.c (property svn:keywords), Revision 31 by knight, Sun Oct 2 20:34:05 2005 UTC vs.
ircd-hybrid/trunk/src/ircd.c (property svn:keywords), Revision 2156 by michael, Fri May 31 20:53:11 2013 UTC

# Line 1 | Line 1
1 < "Id Revision"
1 > Id Revision

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)