]> jfr.im git - solanum.git/blame - src/ircd.c
sslproc.c synced with ircd-ratbox3 svn
[solanum.git] / src / ircd.c
CommitLineData
212380e3 1/*
6fce54ff 2 * charybdis: A slightly useful ircd.
212380e3
AC
3 * ircd.c: Starts up and runs the ircd.
4 *
5 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
6 * Copyright (C) 1996-2002 Hybrid Development Team
6fce54ff
VY
7 * Copyright (C) 2002-2008 ircd-ratbox development team
8 * Copyright (C) 2005-2008 charybdis development team
212380e3
AC
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 * USA
24 *
6fce54ff 25 * $Id$
212380e3
AC
26 */
27
2af8c7ff 28#include "ratbox_lib.h"
212380e3
AC
29#include "stdinc.h"
30#include "setup.h"
31#include "config.h"
212380e3
AC
32#include "ircd.h"
33#include "channel.h"
34#include "class.h"
35#include "client.h"
36#include "common.h"
212380e3 37#include "hash.h"
4562c604 38#include "match.h"
212380e3 39#include "ircd_signal.h"
212380e3
AC
40#include "msg.h" /* msgtab */
41#include "hostmask.h"
42#include "numeric.h"
43#include "parse.h"
44#include "res.h"
45#include "restart.h"
46#include "s_auth.h"
212380e3 47#include "s_conf.h"
4016731b 48#include "logger.h"
212380e3
AC
49#include "s_serv.h" /* try_connections */
50#include "s_user.h"
51#include "s_stats.h"
52#include "scache.h"
53#include "send.h"
54#include "supported.h"
55#include "whowas.h"
56#include "modules.h"
212380e3
AC
57#include "hook.h"
58#include "ircd_getopt.h"
212380e3 59#include "newconf.h"
212380e3
AC
60#include "reject.h"
61#include "s_conf.h"
62#include "s_newconf.h"
63#include "cache.h"
64#include "monitor.h"
212380e3
AC
65#include "patchlevel.h"
66#include "serno.h"
c6d72037 67#include "sslproc.h"
efccc22c 68#include "chmode.h"
212380e3 69
8bd5767b 70/* /quote set variables */
2af8c7ff 71struct SetOptions GlobalSetOptions;
8bd5767b
JT
72
73/* configuration set from ircd.conf */
74struct config_file_entry ConfigFileEntry;
75/* server info set from ircd.conf */
76struct server_info ServerInfo;
77/* admin info set from ircd.conf */
1aad9782
VY
78struct admin_info AdminInfo;
79
8bd5767b 80struct Counter Count;
47adde3d
VY
81struct ServerStatistics ServerStats;
82
1aad9782 83int maxconnections;
8bd5767b 84struct Client me; /* That's me */
1aad9782
VY
85struct LocalUser meLocalUser; /* That's also part of me */
86
3d3d1a95 87rb_dlink_list global_client_list;
8bd5767b 88
3d3d1a95 89/* unknown/client pointer lists */
8bd5767b 90rb_dlink_list unknown_list; /* unknown clients ON this server only */
3d3d1a95 91rb_dlink_list lclient_list; /* local clients only ON this server */
8bd5767b
JT
92rb_dlink_list serv_list; /* local servers to this server ONLY */
93rb_dlink_list global_serv_list; /* global servers on the network */
94rb_dlink_list local_oper_list; /* our opers, duplicated in lclient_list */
b5b84cad
VY
95rb_dlink_list oper_list; /* network opers */
96
8bd5767b 97const char *logFileName = LPATH;
b5b84cad
VY
98const char *pidFileName = PPATH;
99
1aad9782 100char **myargv;
8bd5767b
JT
101int dorehash = 0;
102int dorehashbans = 0;
103int doremotd = 0;
104int kline_queued = 0;
105int server_state_foreground = 0;
106int opers_see_all_users = 0;
107int ssl_ok = 0;
108int zlib_ok = 1;
109
110int testing_conf = 0;
cd27d99c 111time_t startup_time;
8bd5767b 112
cd27d99c 113int default_server_capabs = CAP_MASK;
8bd5767b 114
cd27d99c
VY
115int splitmode;
116int splitchecking;
117int split_users;
118int split_servers;
119int eob_count;
c6d72037 120
fd5af3d0
VY
121void
122ircd_shutdown(const char *reason)
123{
124 struct Client *target_p;
125 rb_dlink_node *ptr;
126
127 RB_DLINK_FOREACH(ptr, lclient_list.head)
128 {
129 target_p = ptr->data;
130
131 sendto_one(target_p, ":%s NOTICE %s :Server Terminating. %s",
132 me.name, target_p->name, reason);
133 }
134
135 RB_DLINK_FOREACH(ptr, serv_list.head)
136 {
137 target_p = ptr->data;
138
139 sendto_one(target_p, ":%s ERROR :Terminated by %s",
140 me.name, reason);
141 }
142
143 ilog(L_MAIN, "Server Terminating. %s", reason);
ea82a3ca 144 close_logfiles();
fd5af3d0
VY
145
146 unlink(pidFileName);
147 exit(0);
148}
149
212380e3
AC
150/*
151 * print_startup - print startup information
152 */
153static void
154print_startup(int pid)
155{
156 inotice("now running in %s mode from %s as pid %d ...",
157 !server_state_foreground ? "background" : "foreground",
158 ConfigFileEntry.dpath, pid);
159
160 /* let the parent process know the initialization was successful
161 * -- jilles */
162 if (!server_state_foreground)
163 write(0, ".", 1);
164 fclose(stdin);
165 fclose(stdout);
166 fclose(stderr);
167 open("/dev/null", O_RDWR);
168 dup2(0, 1);
169 dup2(0, 2);
170}
171
212380e3
AC
172/*
173 * init_sys
174 *
175 * inputs - boot_daemon flag
176 * output - none
177 * side effects - if boot_daemon flag is not set, don't daemonize
178 */
179static void
180init_sys(void)
181{
8bd5767b
JT
182#if defined(RLIMIT_NOFILE) && defined(HAVE_SYS_RESOURCE_H)
183 struct rlimit limit;
184
185 if(!getrlimit(RLIMIT_NOFILE, &limit))
186 {
187 maxconnections = limit.rlim_cur;
188 if(maxconnections <= MAX_BUFFER)
189 {
190 fprintf(stderr, "ERROR: Shell FD limits are too low.\n");
191 fprintf(stderr, "ERROR: ircd-ratbox reserves %d FDs, shell limits must be above this\n", MAX_BUFFER);
192 exit(EXIT_FAILURE);
193 }
194 return;
195 }
196#endif /* RLIMIT_FD_MAX */
101db4c4 197 maxconnections = MAXCONNECTIONS;
212380e3
AC
198}
199
200static int
201make_daemon(void)
202{
203 int pid;
204 int pip[2];
205 char c;
206
207 if (pipe(pip) < 0)
208 {
209 perror("pipe");
210 exit(EXIT_FAILURE);
211 }
212 dup2(pip[1], 0);
213 close(pip[1]);
214 if((pid = fork()) < 0)
215 {
216 perror("fork");
217 exit(EXIT_FAILURE);
218 }
219 else if(pid > 0)
220 {
221 close(0);
222 /* Wait for initialization to finish, successfully or
223 * unsuccessfully. Until this point the child may still
224 * write to stdout/stderr.
225 * -- jilles */
226 if (read(pip[0], &c, 1) > 0)
227 exit(EXIT_SUCCESS);
228 else
229 exit(EXIT_FAILURE);
230 }
231
232 close(pip[0]);
233 setsid();
234/* fclose(stdin);
235 fclose(stdout);
236 fclose(stderr); */
237
238 return 0;
239}
240
241static int printVersion = 0;
242
243struct lgetopt myopts[] = {
244 {"dlinefile", &ConfigFileEntry.dlinefile,
245 STRING, "File to use for dlines.conf"},
246 {"configfile", &ConfigFileEntry.configfile,
247 STRING, "File to use for ircd.conf"},
248 {"klinefile", &ConfigFileEntry.klinefile,
249 STRING, "File to use for kline.conf"},
250 {"xlinefile", &ConfigFileEntry.xlinefile,
251 STRING, "File to use for xline.conf"},
252 {"resvfile", &ConfigFileEntry.resvfile,
253 STRING, "File to use for resv.conf"},
254 {"logfile", &logFileName,
255 STRING, "File to use for ircd.log"},
256 {"pidfile", &pidFileName,
257 STRING, "File to use for process ID"},
258 {"foreground", &server_state_foreground,
259 YESNO, "Run in foreground (don't detach)"},
260 {"version", &printVersion,
261 YESNO, "Print version and exit"},
262 {"conftest", &testing_conf,
263 YESNO, "Test the configuration files and exit"},
264 {"help", NULL, USAGE, "Print this text"},
265 {NULL, NULL, STRING, NULL},
266};
267
212380e3
AC
268static void
269check_rehash(void *unused)
270{
271 /*
272 * Check to see whether we have to rehash the configuration ..
273 */
274 if(dorehash)
275 {
276 rehash(1);
277 dorehash = 0;
278 }
279
280 if(dorehashbans)
281 {
282 rehash_bans(1);
283 dorehashbans = 0;
284 }
285
286 if(doremotd)
287 {
288 sendto_realops_snomask(SNO_GENERAL, L_ALL,
289 "Got signal SIGUSR1, reloading ircd motd file");
041d54ff 290 cache_user_motd();
212380e3
AC
291 doremotd = 0;
292 }
293}
294
212380e3
AC
295/*
296 * initalialize_global_set_options
297 *
298 * inputs - none
299 * output - none
300 * side effects - This sets all global set options needed
301 */
302static void
303initialize_global_set_options(void)
304{
305 memset(&GlobalSetOptions, 0, sizeof(GlobalSetOptions));
306 /* memset( &ConfigFileEntry, 0, sizeof(ConfigFileEntry)); */
307
8bd5767b
JT
308 GlobalSetOptions.maxclients = ServerInfo.default_max_clients;
309
310 if(GlobalSetOptions.maxclients > (maxconnections - MAX_BUFFER) || (GlobalSetOptions.maxclients <= 0))
101db4c4
VY
311 GlobalSetOptions.maxclients = maxconnections - MAX_BUFFER;
312
212380e3
AC
313 GlobalSetOptions.autoconn = 1;
314
315 GlobalSetOptions.spam_time = MIN_JOIN_LEAVE_TIME;
316 GlobalSetOptions.spam_num = MAX_JOIN_LEAVE_COUNT;
317
318 if(ConfigFileEntry.default_floodcount)
319 GlobalSetOptions.floodcount = ConfigFileEntry.default_floodcount;
320 else
321 GlobalSetOptions.floodcount = 10;
322
323 split_servers = ConfigChannel.default_split_server_count;
324 split_users = ConfigChannel.default_split_user_count;
325
326 if(split_users && split_servers
327 && (ConfigChannel.no_create_on_split || ConfigChannel.no_join_on_split))
328 {
329 splitmode = 1;
330 splitchecking = 1;
331 }
332
333 GlobalSetOptions.ident_timeout = IDENT_TIMEOUT;
334
f427c8b0 335 rb_strlcpy(GlobalSetOptions.operstring,
212380e3
AC
336 ConfigFileEntry.default_operstring,
337 sizeof(GlobalSetOptions.operstring));
f427c8b0 338 rb_strlcpy(GlobalSetOptions.adminstring,
212380e3
AC
339 ConfigFileEntry.default_adminstring,
340 sizeof(GlobalSetOptions.adminstring));
341
342 /* memset( &ConfigChannel, 0, sizeof(ConfigChannel)); */
343
344 /* End of global set options */
345
346}
347
348/*
349 * initialize_server_capabs
350 *
351 * inputs - none
352 * output - none
353 */
354static void
355initialize_server_capabs(void)
356{
357 default_server_capabs &= ~CAP_ZIP;
358}
359
360
361/*
362 * write_pidfile
363 *
364 * inputs - filename+path of pid file
365 * output - none
366 * side effects - write the pid of the ircd to filename
367 */
368static void
369write_pidfile(const char *filename)
370{
371 FILE *fb;
372 char buff[32];
373 if((fb = fopen(filename, "w")))
374 {
375 unsigned int pid = (unsigned int) getpid();
376
b2f0da88 377 rb_snprintf(buff, sizeof(buff), "%u\n", pid);
212380e3
AC
378 if((fputs(buff, fb) == -1))
379 {
380 ilog(L_MAIN, "Error writing %u to pid file %s (%s)",
381 pid, filename, strerror(errno));
382 }
383 fclose(fb);
384 return;
385 }
386 else
387 {
388 ilog(L_MAIN, "Error opening pid file %s", filename);
389 }
390}
391
392/*
393 * check_pidfile
394 *
395 * inputs - filename+path of pid file
396 * output - none
397 * side effects - reads pid from pidfile and checks if ircd is in process
398 * list. if it is, gracefully exits
399 * -kre
400 */
401static void
402check_pidfile(const char *filename)
403{
404 FILE *fb;
405 char buff[32];
406 pid_t pidfromfile;
407
408 /* Don't do logging here, since we don't have log() initialised */
409 if((fb = fopen(filename, "r")))
410 {
411 if(fgets(buff, 20, fb) != NULL)
412 {
413 pidfromfile = atoi(buff);
414 if(!kill(pidfromfile, 0))
415 {
416 printf("ircd: daemon is already running\n");
417 exit(-1);
418 }
419 }
420 fclose(fb);
421 }
422}
423
424/*
425 * setup_corefile
426 *
427 * inputs - nothing
428 * output - nothing
429 * side effects - setups corefile to system limits.
430 * -kre
431 */
432static void
433setup_corefile(void)
434{
435#ifdef HAVE_SYS_RESOURCE_H
436 struct rlimit rlim; /* resource limits */
437
438 /* Set corefilesize to maximum */
439 if(!getrlimit(RLIMIT_CORE, &rlim))
440 {
441 rlim.rlim_cur = rlim.rlim_max;
442 setrlimit(RLIMIT_CORE, &rlim);
443 }
444#endif
445}
446
6fce54ff
VY
447static void
448ircd_log_cb(const char *str)
449{
450 ilog(L_MAIN, "%s", str);
451}
452
453static void
454ircd_restart_cb(const char *str)
455{
456 restart(str);
457}
458
459/*
460 * Why EXIT_FAILURE here?
461 * Because if ircd_die_cb() is called it's because of a fatal
462 * error inside libcharybdis, and we don't know how to handle the
463 * exception, so it is logical to return a FAILURE exit code here.
464 * --nenolod
465 */
466static void
467ircd_die_cb(const char *str)
468{
469 if(str != NULL)
470 {
471 /* Try to get the message out to currently logged in operators. */
472 sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "Server panic! %s", str);
473 inotice("server panic: %s", str);
474 }
475
476 unlink(pidFileName);
477 exit(EXIT_FAILURE);
478}
479
fa832850
AC
480struct ev_entry *check_splitmode_ev = NULL;
481
d80645d0
VY
482static int
483seed_with_urandom(void)
484{
485 unsigned int seed;
486 int fd;
487
488 fd = open("/dev/urandom", O_RDONLY);
489 if(fd >= 0)
490 {
491 if(read(fd, &seed, sizeof(seed)) == sizeof(seed))
492 {
493 close(fd);
494 srand(seed);
495 return 1;
496 }
497 }
498 return 0;
499}
500
501static void
502seed_with_clock(void)
503{
504 const struct timeval *tv;
505 rb_set_time();
506 tv = rb_current_time_tv();
507 srand(tv->tv_sec ^ (tv->tv_usec | (getpid() << 20)));
508}
509
510static void
511seed_random(void *unused)
512{
513 unsigned int seed;
514 if(rb_get_random(&seed, sizeof(seed)) == -1)
515 {
516 if(!seed_with_urandom())
517 seed_with_clock();
518 return;
519 }
520 srand(seed);
521}
522
212380e3
AC
523/*
524 * main
525 *
526 * Initializes the IRCd.
527 *
528 * Inputs - number of commandline args, args themselves
529 * Outputs - none
530 * Side Effects - this is where the ircd gets going right now
531 */
532int
533main(int argc, char *argv[])
534{
535 int fd;
536
537 /* Check to see if the user is running us as root, which is a nono */
538 if(geteuid() == 0)
539 {
540 fprintf(stderr, "Don't run ircd as root!!!\n");
541 return -1;
542 }
543
adc7be98
VY
544 init_sys();
545
546
547
548 myargv = argv;
549 parseargs(&argc, &argv, myopts);
550
551 if(chdir(ConfigFileEntry.dpath))
552 {
553 fprintf(stderr, "Unable to chdir to %s: %s\n", ConfigFileEntry.dpath, strerror(errno));
554 exit(EXIT_FAILURE);
555 }
556
3d3d1a95
VY
557 rb_set_time();
558
212380e3
AC
559 /*
560 * Setup corefile size immediately after boot -kre
561 */
562 setup_corefile();
563
212380e3
AC
564 memset(&me, 0, sizeof(me));
565 memset(&meLocalUser, 0, sizeof(meLocalUser));
566 me.localClient = &meLocalUser;
567
568 /* Make sure all lists are zeroed */
569 memset(&unknown_list, 0, sizeof(unknown_list));
570 memset(&lclient_list, 0, sizeof(lclient_list));
571 memset(&serv_list, 0, sizeof(serv_list));
572 memset(&global_serv_list, 0, sizeof(global_serv_list));
573 memset(&local_oper_list, 0, sizeof(local_oper_list));
574 memset(&oper_list, 0, sizeof(oper_list));
575
330fc5c1 576 rb_dlinkAddTail(&me, &me.node, &global_client_list);
212380e3 577
2af8c7ff
VY
578 memset(&Count, 0, sizeof(Count));
579 memset(&ServerInfo, 0, sizeof(ServerInfo));
580 memset(&AdminInfo, 0, sizeof(AdminInfo));
581 memset(&ServerStats, 0, sizeof(struct ServerStatistics));
212380e3
AC
582
583 /* Initialise the channel capability usage counts... */
584 init_chcap_usage_counts();
585
586 ConfigFileEntry.dpath = DPATH;
587 ConfigFileEntry.configfile = CPATH; /* Server configuration file */
588 ConfigFileEntry.klinefile = KPATH; /* Server kline file */
589 ConfigFileEntry.dlinefile = DLPATH; /* dline file */
590 ConfigFileEntry.xlinefile = XPATH;
591 ConfigFileEntry.resvfile = RESVPATH;
592 ConfigFileEntry.connect_timeout = 30; /* Default to 30 */
adc7be98 593
212380e3
AC
594 umask(077); /* better safe than sorry --SRB */
595
adc7be98 596
212380e3
AC
597
598 if(printVersion)
599 {
b3803848 600 printf("ircd: version %s(%s)\n", ircd_version, serno);
212380e3
AC
601 exit(EXIT_SUCCESS);
602 }
603
adc7be98 604
212380e3
AC
605
606 setup_signals();
607
212380e3
AC
608 if (testing_conf)
609 server_state_foreground = 1;
610
611 /* Make sure fd 0, 1 and 2 are in use -- jilles */
612 do
613 {
614 fd = open("/dev/null", O_RDWR);
615 } while (fd < 2 && fd != -1);
616 if (fd > 2)
617 close(fd);
618 else if (fd == -1)
619 exit(1);
620
621 /* Check if there is pidfile and daemon already running */
622 if(!testing_conf)
623 {
624 check_pidfile(pidFileName);
625
626 if(!server_state_foreground)
627 make_daemon();
628 inotice("starting %s ...", ircd_version);
629 }
630
631 /* Init the event subsystem */
0edb29fa 632 rb_lib_init(ircd_log_cb, ircd_restart_cb, ircd_die_cb, !server_state_foreground, maxconnections, DNODE_HEAP_SIZE, FD_HEAP_SIZE);
150f35f7 633 rb_linebuf_init(LINEBUF_HEAP_SIZE);
212380e3
AC
634
635 init_main_logfile();
212380e3
AC
636 newconf_init();
637 init_s_conf();
638 init_s_newconf();
639 init_hash();
640 clear_scache_hash_table(); /* server cache name table */
641 init_host_hash();
642 clear_hash_parse();
643 init_client();
212380e3
AC
644 init_hook();
645 init_channels();
646 initclass();
647 initwhowas();
212380e3
AC
648 init_reject();
649 init_cache();
650 init_monitor();
651 init_isupport();
652 load_all_modules(1);
653#ifndef STATIC_MODULES
654 load_core_modules(1);
655#endif
656 init_auth(); /* Initialise the auth code */
657 init_resolver(); /* Needs to be setup before the io loop */
658
659 if (testing_conf)
660 fprintf(stderr, "\nBeginning config test\n");
661 read_conf_files(YES); /* cold start init conf files */
662 rehash_bans(0);
663#ifndef STATIC_MODULES
664
665 mod_add_path(MODULE_DIR);
666 mod_add_path(MODULE_DIR "/autoload");
667#endif
668
c6d72037
VY
669 init_ssld();
670
212380e3
AC
671 initialize_server_capabs(); /* Set up default_server_capabs */
672 initialize_global_set_options();
673
674 if(ServerInfo.name == NULL)
675 {
676 ierror("no server name specified in serverinfo block.");
677 return -1;
678 }
f427c8b0 679 rb_strlcpy(me.name, ServerInfo.name, sizeof(me.name));
212380e3
AC
680
681 if(ServerInfo.sid[0] == '\0')
682 {
683 ierror("no server sid specified in serverinfo block.");
684 return -2;
685 }
686 strcpy(me.id, ServerInfo.sid);
687 init_uid();
688
689 /* serverinfo{} description must exist. If not, error out. */
690 if(ServerInfo.description == NULL)
691 {
692 ierror("no server description specified in serverinfo block.");
693 return -3;
694 }
f427c8b0 695 rb_strlcpy(me.info, ServerInfo.description, sizeof(me.info));
212380e3 696
8bd5767b
JT
697 if(ServerInfo.ssl_cert != NULL && ServerInfo.ssl_private_key != NULL)
698 {
699 /* just do the rb_setup_ssl_server to validate the config */
700 if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params))
701 {
702 ilog(L_MAIN, "WARNING: Unable to setup SSL.");
703 ssl_ok = 0;
704 }
705 else
706 ssl_ok = 1;
c6d72037
VY
707 }
708
212380e3
AC
709 if (testing_conf)
710 {
711 fprintf(stderr, "\nConfig testing complete.\n");
712 fflush(stderr);
713 return 0; /* Why? We want the launcher to exit out. */
714 }
715
716 me.from = &me;
717 me.servptr = &me;
718 SetMe(&me);
719 make_server(&me);
e3354945 720 startup_time = rb_current_time();
212380e3
AC
721 add_to_client_hash(me.name, &me);
722 add_to_id_hash(me.id, &me);
994544c2 723 me.serv->nameinfo = scache_connect(me.name, me.info, 0);
212380e3 724
330fc5c1 725 rb_dlinkAddAlloc(&me, &global_serv_list);
212380e3
AC
726
727 construct_umodebuf();
efccc22c 728 construct_noparam_modes();
212380e3
AC
729
730 check_class();
731 write_pidfile(pidFileName);
732 load_help();
733 open_logfiles();
734
735 ilog(L_MAIN, "Server Ready");
736
212380e3
AC
737 /* We want try_connections to be called as soon as possible now! -- adrian */
738 /* No, 'cause after a restart it would cause all sorts of nick collides */
739 /* um. by waiting even longer, that just means we have even *more*
740 * nick collisions. what a stupid idea. set an event for the IO loop --fl
741 */
12aea5fe 742 rb_event_addish("try_connections", try_connections, NULL, STARTUP_CONNECTIONS_TIME);
36645728
VY
743 rb_event_addonce("try_connections_startup", try_connections, NULL, 2);
744 rb_event_add("check_rehash", check_rehash, NULL, 3);
d80645d0 745 rb_event_addish("reseed_srand", seed_random, NULL, 300); /* reseed every 10 minutes */
212380e3 746
212380e3 747 if(splitmode)
36645728 748 check_splitmode_ev = rb_event_add("check_splitmode", check_splitmode, NULL, 5);
212380e3 749
212380e3
AC
750 print_startup(getpid());
751
39944e1f 752 rb_lib_loop(0);
212380e3
AC
753
754 return 0;
755}