ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/ircd.c
Revision: 5737
Committed: Sun Mar 29 11:11:20 2015 UTC (11 years, 6 months ago) by michael
Content type: text/x-csrc
File size: 16730 byte(s)
Log Message:
- ircd.c:write_pidfile(): removed the PID from the error message

File Contents

# User Rev Content
1 adx 30 /*
2 michael 2916 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 adx 30 *
4 michael 5347 * Copyright (c) 1997-2015 ircd-hybrid development team
5 adx 30 *
6     * This program is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (at your option) any later version.
10     *
11     * This program is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with this program; if not, write to the Free Software
18 michael 4565 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19 adx 30 * USA
20     */
21    
22 michael 2916 /*! \file ircd.c
23     * \brief Starts up and runs the ircd.
24     * \version $Id$
25     */
26    
27 adx 30 #include "stdinc.h"
28 michael 3347 #include "user.h"
29 michael 1011 #include "list.h"
30 adx 30 #include "ircd.h"
31     #include "channel.h"
32     #include "client.h"
33     #include "event.h"
34     #include "fdlist.h"
35     #include "hash.h"
36     #include "irc_string.h"
37     #include "ircd_signal.h"
38 michael 3321 #include "gline.h"
39 adx 30 #include "motd.h"
40 michael 1632 #include "conf.h"
41 adx 30 #include "hostmask.h"
42     #include "parse.h"
43 michael 3322 #include "res.h"
44 adx 30 #include "restart.h"
45 michael 982 #include "rng_mt.h"
46 michael 3324 #include "auth.h"
47 adx 30 #include "s_bsd.h"
48 michael 1309 #include "log.h"
49 michael 3347 #include "server.h" /* try_connections */
50 adx 30 #include "send.h"
51     #include "whowas.h"
52     #include "modules.h"
53     #include "memory.h"
54 michael 1654 #include "mempool.h"
55 adx 30 #include "ircd_getopt.h"
56 michael 876 #include "watch.h"
57 michael 1622 #include "conf_db.h"
58 michael 1632 #include "conf_class.h"
59 michael 4325 #include "ipcache.h"
60 adx 30
61 michael 1858
62     #ifdef HAVE_LIBGEOIP
63     GeoIP *geoip_ctx;
64     #endif
65 michael 2872
66 michael 5737 struct SetOptions GlobalSetOptions; /* /quote set variables */
67 michael 5602 struct Counter Count;
68     struct ServerState_t server_state;
69     struct ServerStatistics ServerStats;
70 adx 30 struct timeval SystemTime;
71 michael 5737 struct Connection meConnection; /* That's also part of me */
72 michael 5470 struct Client me = { .connection = &meConnection }; /* That's me */
73 adx 30
74 michael 5460 char **myargv;
75 adx 30 const char *logFileName = LPATH;
76     const char *pidFileName = PPATH;
77    
78 michael 5460 unsigned int dorehash;
79     unsigned int doremotd;
80 michael 3907 unsigned int default_server_capabs;
81 michael 1013 unsigned int splitmode;
82     unsigned int splitchecking;
83     unsigned int split_users;
84 adx 30 unsigned int split_servers;
85    
86 michael 4094 static struct event event_cleanup_glines =
87     {
88     .name = "cleanup_glines",
89     .handler = cleanup_glines,
90     .when = CLEANUP_GLINES_TIME
91     };
92    
93     static struct event event_cleanup_tklines =
94     {
95     .name = "cleanup_tklines",
96     .handler = cleanup_tklines,
97     .when = CLEANUP_TKLINES_TIME
98     };
99    
100     static struct event event_try_connections =
101     {
102     .name = "try_connections",
103     .handler = try_connections,
104     .when = STARTUP_CONNECTIONS_TIME
105     };
106    
107     static struct event event_comm_checktimeouts =
108     {
109     .name = "comm_checktimeouts",
110     .handler = comm_checktimeouts,
111     .when = 1
112     };
113    
114     static struct event event_save_all_databases =
115     {
116     .name = "save_all_databases",
117     .handler = save_all_databases,
118     .when = DATABASE_UPDATE_TIMEOUT
119     };
120    
121     struct event event_write_links_file =
122     {
123     .name = "write_links_file",
124     .handler = write_links_file,
125     };
126    
127    
128 adx 30 /*
129     * print_startup - print startup information
130     */
131     static void
132     print_startup(int pid)
133     {
134 michael 2646 printf("ircd: version %s(%s)\n", ircd_version, serno);
135 adx 30 printf("ircd: pid %d\n", pid);
136     printf("ircd: running in %s mode from %s\n", !server_state.foreground ? "background"
137 michael 4340 : "foreground", ConfigGeneral.dpath);
138 adx 30 }
139    
140     static void
141     make_daemon(void)
142     {
143     int pid;
144    
145     if ((pid = fork()) < 0)
146     {
147     perror("fork");
148     exit(EXIT_FAILURE);
149     }
150     else if (pid > 0)
151     {
152     print_startup(pid);
153     exit(EXIT_SUCCESS);
154     }
155    
156     setsid();
157     }
158    
159     static int printVersion = 0;
160    
161 michael 3215 static struct lgetopt myopts[] =
162     {
163 michael 4340 {"configfile", &ConfigGeneral.configfile,
164 adx 30 STRING, "File to use for ircd.conf"},
165 michael 4340 {"glinefile", &ConfigGeneral.glinefile,
166 michael 1718 STRING, "File to use for gline database"},
167 michael 4340 {"klinefile", &ConfigGeneral.klinefile,
168 michael 1718 STRING, "File to use for kline database"},
169 michael 4340 {"dlinefile", &ConfigGeneral.dlinefile,
170 michael 1718 STRING, "File to use for dline database"},
171 michael 4340 {"xlinefile", &ConfigGeneral.xlinefile,
172 michael 1718 STRING, "File to use for xline database"},
173 michael 4340 {"resvfile", &ConfigGeneral.resvfile,
174 michael 1718 STRING, "File to use for resv database"},
175 michael 2916 {"logfile", &logFileName,
176 adx 30 STRING, "File to use for ircd.log"},
177     {"pidfile", &pidFileName,
178     STRING, "File to use for process ID"},
179 michael 2916 {"foreground", &server_state.foreground,
180 adx 30 YESNO, "Run in foreground (don't detach)"},
181 michael 2916 {"version", &printVersion,
182 adx 30 YESNO, "Print version and exit"},
183     {"help", NULL, USAGE, "Print this text"},
184     {NULL, NULL, STRING, NULL},
185     };
186    
187     void
188     set_time(void)
189     {
190 michael 2978 struct timeval newtime = { .tv_sec = 0, .tv_usec = 0 };
191 adx 30
192     if (gettimeofday(&newtime, NULL) == -1)
193     {
194 michael 1247 ilog(LOG_TYPE_IRCD, "Clock Failure (%s), TS can be corrupted",
195 adx 30 strerror(errno));
196 michael 1618 sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
197 adx 30 "Clock Failure (%s), TS can be corrupted",
198     strerror(errno));
199 michael 3167 server_die("Clock Failure", 1);
200 adx 30 }
201    
202     if (newtime.tv_sec < CurrentTime)
203     {
204 michael 2980 ilog(LOG_TYPE_IRCD, "System clock is running backwards - (%lu < %lu)",
205     (unsigned long)newtime.tv_sec, (unsigned long)CurrentTime);
206     sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE,
207     "System clock is running backwards - (%lu < %lu)",
208     (unsigned long)newtime.tv_sec,
209     (unsigned long)CurrentTime);
210 adx 30 set_back_events(CurrentTime - newtime.tv_sec);
211     }
212    
213     SystemTime.tv_sec = newtime.tv_sec;
214     SystemTime.tv_usec = newtime.tv_usec;
215     }
216    
217     static void
218     io_loop(void)
219     {
220 michael 3215 while (1)
221 adx 30 {
222     if (listing_client_list.head)
223     {
224 michael 4815 dlink_node *node = NULL, *node_next = NULL;
225     DLINK_FOREACH_SAFE(node, node_next, listing_client_list.head)
226     safe_list_channels(node->data, 0);
227 adx 30 }
228    
229 michael 4094 /* Run pending events */
230     event_run();
231 adx 30
232     comm_select();
233     exit_aborted_clients();
234     free_exited_clients();
235    
236     /* Check to see whether we have to rehash the configuration .. */
237     if (dorehash)
238     {
239 michael 4982 conf_rehash(1);
240 adx 30 dorehash = 0;
241     }
242 michael 3215
243 adx 30 if (doremotd)
244     {
245 michael 2150 motd_recache();
246 michael 1618 sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
247 michael 3065 "Got signal SIGUSR1, reloading motd file(s)");
248 adx 30 doremotd = 0;
249     }
250     }
251     }
252    
253     /* initalialize_global_set_options()
254     *
255     * inputs - none
256     * output - none
257 michael 2916 * side effects - This sets all global set options needed
258 adx 30 */
259     static void
260     initialize_global_set_options(void)
261     {
262 michael 5489 GlobalSetOptions.maxclients = ConfigServerInfo.default_max_clients;
263 michael 5499 GlobalSetOptions.autoconn = 1;
264 adx 30 GlobalSetOptions.spam_time = MIN_JOIN_LEAVE_TIME;
265 michael 5499 GlobalSetOptions.spam_num = MAX_JOIN_LEAVE_COUNT;
266     GlobalSetOptions.floodcount = ConfigGeneral.default_floodcount;
267 michael 5489 GlobalSetOptions.joinfloodcount = ConfigChannel.default_join_flood_count;
268     GlobalSetOptions.joinfloodtime = ConfigChannel.default_join_flood_time;
269 adx 30
270     split_servers = ConfigChannel.default_split_server_count;
271     split_users = ConfigChannel.default_split_user_count;
272    
273     if (split_users && split_servers && (ConfigChannel.no_create_on_split ||
274     ConfigChannel.no_join_on_split))
275     {
276     splitmode = 1;
277     splitchecking = 1;
278     }
279    
280     GlobalSetOptions.ident_timeout = IDENT_TIMEOUT;
281     }
282    
283     /* initialize_server_capabs()
284     *
285     * inputs - none
286     * output - none
287     */
288     static void
289     initialize_server_capabs(void)
290     {
291     add_capability("QS", CAP_QS, 1);
292     add_capability("EOB", CAP_EOB, 1);
293 michael 1117 add_capability("TS6", CAP_TS6, 0);
294 adx 30 add_capability("CLUSTER", CAP_CLUSTER, 1);
295 michael 1196 add_capability("SVS", CAP_SVS, 1);
296 michael 3267 add_capability("CHW", CAP_CHW, 1);
297 adx 30 add_capability("HOPS", CAP_HOPS, 1);
298     }
299    
300     /* write_pidfile()
301     *
302     * inputs - filename+path of pid file
303     * output - NONE
304     * side effects - write the pid of the ircd to filename
305     */
306     static void
307     write_pidfile(const char *filename)
308     {
309 michael 1325 FILE *fb;
310 adx 30
311 michael 1325 if ((fb = fopen(filename, "w")))
312 adx 30 {
313 michael 2691 char buff[IRCD_BUFSIZE];
314 adx 30 unsigned int pid = (unsigned int)getpid();
315    
316 michael 1325 snprintf(buff, sizeof(buff), "%u\n", pid);
317    
318 michael 4736 if (fputs(buff, fb) == -1)
319 michael 5737 ilog(LOG_TYPE_IRCD, "Error writing to pid file %s: %s",
320     filename, strerror(errno));
321 adx 30
322 michael 1325 fclose(fb);
323 adx 30 }
324     else
325 michael 5566 ilog(LOG_TYPE_IRCD, "Error opening pid file %s: %s",
326 michael 4748 filename, strerror(errno));
327 adx 30 }
328    
329     /* check_pidfile()
330     *
331     * inputs - filename+path of pid file
332     * output - none
333     * side effects - reads pid from pidfile and checks if ircd is in process
334     * list. if it is, gracefully exits
335     * -kre
336     */
337     static void
338     check_pidfile(const char *filename)
339     {
340 michael 1325 FILE *fb;
341 michael 2691 char buff[IRCD_BUFSIZE];
342 adx 30 pid_t pidfromfile;
343    
344     /* Don't do logging here, since we don't have log() initialised */
345 michael 1325 if ((fb = fopen(filename, "r")))
346 adx 30 {
347 michael 4733 if (!fgets(buff, 20, fb))
348 adx 30 {
349     /* log(L_ERROR, "Error reading from pid file %s (%s)", filename,
350     * strerror(errno));
351     */
352     }
353     else
354     {
355     pidfromfile = atoi(buff);
356    
357     if (!kill(pidfromfile, 0))
358     {
359     /* log(L_ERROR, "Server is already running"); */
360     printf("ircd: daemon is already running\n");
361     exit(-1);
362     }
363     }
364    
365 michael 1325 fclose(fb);
366 adx 30 }
367     else if (errno != ENOENT)
368     {
369     /* log(L_ERROR, "Error opening pid file %s", filename); */
370     }
371     }
372    
373     /* setup_corefile()
374     *
375     * inputs - nothing
376     * output - nothing
377     * side effects - setups corefile to system limits.
378     * -kre
379     */
380     static void
381     setup_corefile(void)
382     {
383     #ifdef HAVE_SYS_RESOURCE_H
384     struct rlimit rlim; /* resource limits */
385    
386     /* Set corefilesize to maximum */
387     if (!getrlimit(RLIMIT_CORE, &rlim))
388     {
389     rlim.rlim_cur = rlim.rlim_max;
390     setrlimit(RLIMIT_CORE, &rlim);
391     }
392     #endif
393     }
394    
395 michael 2228 #ifdef HAVE_LIBCRYPTO
396     static int
397     always_accept_verify_cb(int preverify_ok, X509_STORE_CTX *x509_ctx)
398     {
399     return 1;
400     }
401     #endif
402    
403 adx 30 /* init_ssl()
404     *
405     * inputs - nothing
406     * output - nothing
407     * side effects - setups SSL context.
408     */
409     static void
410 michael 1798 ssl_init(void)
411 adx 30 {
412     #ifdef HAVE_LIBCRYPTO
413     SSL_load_error_strings();
414     SSLeay_add_ssl_algorithms();
415    
416 michael 4733 if (!(ConfigServerInfo.server_ctx = SSL_CTX_new(SSLv23_server_method())))
417 adx 30 {
418 michael 4129 const char *s = ERR_lib_error_string(ERR_get_error());
419 adx 30
420 michael 4129 fprintf(stderr, "ERROR: Could not initialize the SSL Server context -- %s\n", s);
421 michael 4763 ilog(LOG_TYPE_IRCD, "ERROR: Could not initialize the SSL Server context -- %s", s);
422 michael 4497 exit(EXIT_FAILURE);
423 michael 4751 return; /* Not reached */
424 adx 30 }
425    
426 michael 4730 SSL_CTX_set_options(ConfigServerInfo.server_ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TICKET);
427 michael 4593 SSL_CTX_set_options(ConfigServerInfo.server_ctx, SSL_OP_SINGLE_DH_USE|SSL_OP_CIPHER_SERVER_PREFERENCE);
428 michael 4340 SSL_CTX_set_verify(ConfigServerInfo.server_ctx, SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE,
429 michael 2228 always_accept_verify_cb);
430 michael 4730 SSL_CTX_set_session_cache_mode(ConfigServerInfo.server_ctx, SSL_SESS_CACHE_OFF);
431 michael 4892 SSL_CTX_set_cipher_list(ConfigServerInfo.server_ctx, "EECDH+HIGH:EDH+HIGH:HIGH:!aNULL");
432 adx 30
433 michael 4744 #if OPENSSL_VERSION_NUMBER >= 0x009080FFL && !defined(OPENSSL_NO_ECDH)
434 michael 4070 {
435     EC_KEY *key = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
436    
437     if (key)
438     {
439 michael 4340 SSL_CTX_set_tmp_ecdh(ConfigServerInfo.server_ctx, key);
440 michael 4070 EC_KEY_free(key);
441     }
442     }
443    
444 michael 4340 SSL_CTX_set_options(ConfigServerInfo.server_ctx, SSL_OP_SINGLE_ECDH_USE);
445 michael 4070 #endif
446    
447 michael 4733 if (!(ConfigServerInfo.client_ctx = SSL_CTX_new(SSLv23_client_method())))
448 michael 1303 {
449 michael 4129 const char *s = ERR_lib_error_string(ERR_get_error());
450 michael 1303
451 michael 4129 fprintf(stderr, "ERROR: Could not initialize the SSL Client context -- %s\n", s);
452 michael 4763 ilog(LOG_TYPE_IRCD, "ERROR: Could not initialize the SSL Client context -- %s", s);
453 michael 4497 exit(EXIT_FAILURE);
454 michael 4751 return; /* Not reached */
455 michael 1303 }
456    
457 michael 4730 SSL_CTX_set_options(ConfigServerInfo.client_ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TICKET);
458 michael 4340 SSL_CTX_set_options(ConfigServerInfo.client_ctx, SSL_OP_SINGLE_DH_USE);
459     SSL_CTX_set_verify(ConfigServerInfo.client_ctx, SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE,
460 michael 2228 always_accept_verify_cb);
461 michael 4730 SSL_CTX_set_session_cache_mode(ConfigServerInfo.client_ctx, SSL_SESS_CACHE_OFF);
462 adx 30 #endif /* HAVE_LIBCRYPTO */
463     }
464    
465     int
466     main(int argc, char *argv[])
467     {
468 michael 2253 /* Check to see if the user is running us as root, which is a nono */
469 michael 4733 if (!geteuid())
470 adx 30 {
471 michael 3525 fprintf(stderr, "ERROR: This server won't run as root/superuser\n");
472 michael 982 return -1;
473 adx 30 }
474    
475     /* Setup corefile size immediately after boot -kre */
476     setup_corefile();
477    
478 michael 5545 /* Save server boot time right away, so getrusage works correctly */
479 adx 30 set_time();
480    
481 michael 5545 /* It's not random, but it ought to be a little harder to guess */
482 michael 982 init_genrand(SystemTime.tv_sec ^ (SystemTime.tv_usec | (getpid() << 20)));
483    
484 michael 5545 dlinkAdd(&me, &me.node, &global_client_list);
485    
486 michael 4340 ConfigGeneral.dpath = DPATH;
487     ConfigGeneral.spath = SPATH;
488     ConfigGeneral.mpath = MPATH;
489     ConfigGeneral.configfile = CPATH; /* Server configuration file */
490     ConfigGeneral.klinefile = KPATH; /* Server kline file */
491     ConfigGeneral.glinefile = GPATH; /* Server gline file */
492     ConfigGeneral.xlinefile = XPATH; /* Server xline file */
493     ConfigGeneral.dlinefile = DLPATH; /* dline file */
494     ConfigGeneral.resvfile = RESVPATH; /* resv file */
495 michael 1702
496 adx 30 myargv = argv;
497 michael 5723 umask(077); /* umask 077: u=rwx,g=,o= */
498 adx 30
499     parseargs(&argc, &argv, myopts);
500    
501     if (printVersion)
502     {
503 michael 2646 printf("ircd: version %s(%s)\n", ircd_version, serno);
504 adx 30 exit(EXIT_SUCCESS);
505     }
506    
507 michael 4340 if (chdir(ConfigGeneral.dpath))
508 adx 30 {
509     perror("chdir");
510     exit(EXIT_FAILURE);
511     }
512    
513 michael 1798 ssl_init();
514 adx 30
515     if (!server_state.foreground)
516     {
517     make_daemon();
518     close_standard_fds(); /* this needs to be before init_netio()! */
519     }
520     else
521     print_startup(getpid());
522    
523     setup_signals();
524    
525     /* We need this to initialise the fd array before anything else */
526     fdlist_init();
527 michael 1831 log_set_file(LOG_TYPE_IRCD, 0, logFileName);
528 michael 4415
529 michael 2632 init_netio(); /* This needs to be setup early ! -- adrian */
530 michael 2253
531 adx 30 /* Check if there is pidfile and daemon already running */
532     check_pidfile(pidFileName);
533    
534 michael 1654 mp_pool_init();
535 adx 30 init_dlink_nodes();
536 michael 2159 init_isupport();
537 adx 30 dbuf_init();
538 michael 1798 hash_init();
539 michael 4319 ipcache_init();
540 michael 1798 client_init();
541 michael 1632 class_init();
542 michael 1358 whowas_init();
543 michael 876 watch_init();
544 michael 1798 auth_init(); /* Initialise the auth code */
545 michael 998 init_resolver(); /* Needs to be setup before the io loop */
546 michael 1404 modules_init();
547 adx 30 read_conf_files(1); /* cold start init conf files */
548     init_uid();
549     initialize_server_capabs(); /* Set up default_server_capabs */
550 michael 5489 initialize_global_set_options(); /* Has to be called after read_conf_files() */
551 michael 1798 channel_init();
552 michael 2216 read_links_file();
553 michael 2150 motd_init();
554 michael 5392 user_usermodes_init();
555 michael 1858 #ifdef HAVE_LIBGEOIP
556     geoip_ctx = GeoIP_new(GEOIP_MEMORY_CACHE);
557     #endif
558 adx 30
559 michael 4340 if (EmptyString(ConfigServerInfo.sid))
560 adx 30 {
561 michael 1247 ilog(LOG_TYPE_IRCD, "ERROR: No server id specified in serverinfo block.");
562 adx 30 exit(EXIT_FAILURE);
563     }
564 michael 885
565 michael 4340 strlcpy(me.id, ConfigServerInfo.sid, sizeof(me.id));
566 michael 1115
567 michael 4340 if (EmptyString(ConfigServerInfo.name))
568 michael 1115 {
569 michael 1247 ilog(LOG_TYPE_IRCD, "ERROR: No server name specified in serverinfo block.");
570 michael 1115 exit(EXIT_FAILURE);
571     }
572    
573 michael 4340 strlcpy(me.name, ConfigServerInfo.name, sizeof(me.name));
574 adx 30
575     /* serverinfo{} description must exist. If not, error out.*/
576 michael 4340 if (EmptyString(ConfigServerInfo.description))
577 adx 30 {
578 michael 1247 ilog(LOG_TYPE_IRCD, "ERROR: No server description specified in serverinfo block.");
579 adx 30 exit(EXIT_FAILURE);
580     }
581 michael 885
582 michael 4340 strlcpy(me.info, ConfigServerInfo.description, sizeof(me.info));
583 adx 30
584 michael 5545 me.from = &me;
585     me.servptr = &me;
586     me.connection->lasttime = CurrentTime;
587     me.connection->since = CurrentTime;
588 michael 4588 me.connection->firsttime = CurrentTime;
589 adx 30
590     SetMe(&me);
591     make_server(&me);
592    
593 michael 1115 hash_add_id(&me);
594 adx 30 hash_add_client(&me);
595 michael 2916
596 michael 4209 dlinkAdd(&me, make_dlink_node(), &global_server_list);
597 adx 30
598 michael 1622 load_kline_database();
599     load_dline_database();
600     load_gline_database();
601     load_xline_database();
602     load_resv_database();
603    
604 adx 30 load_all_modules(1);
605     load_conf_modules();
606     load_core_modules(1);
607 michael 1115
608 adx 30 write_pidfile(pidFileName);
609    
610 michael 1247 ilog(LOG_TYPE_IRCD, "Server Ready");
611 adx 30
612 michael 4094 event_addish(&event_cleanup_glines, NULL);
613     event_addish(&event_cleanup_tklines, NULL);
614 adx 30
615     /* We want try_connections to be called as soon as possible now! -- adrian */
616     /* No, 'cause after a restart it would cause all sorts of nick collides */
617 michael 4094 event_addish(&event_try_connections, NULL);
618 adx 30
619     /* Setup the timeout check. I'll shift it later :) -- adrian */
620 michael 4399 event_add(&event_comm_checktimeouts, NULL);
621 adx 30
622 michael 4094 event_addish(&event_save_all_databases, NULL);
623 michael 1625
624 adx 30 if (ConfigServerHide.links_delay > 0)
625 michael 4094 {
626     event_write_links_file.when = ConfigServerHide.links_delay;
627     event_addish(&event_write_links_file, NULL);
628     }
629 adx 30 else
630     ConfigServerHide.links_disabled = 1;
631    
632     if (splitmode)
633 michael 4133 event_addish(&splitmode_event, NULL);
634 adx 30
635     io_loop();
636 michael 885 return 0;
637 adx 30 }

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision