Anope IRC Services  Version 1.8
main.c
Go to the documentation of this file.
1 /* Services -- main source file.
2  *
3  * (C) 2003-2014 Anope Team
4  * Contact us at team@anope.org
5  *
6  * Please read COPYING and README for further details.
7  *
8  * Based on the original code of Epona by Lara.
9  * Based on the original code of Services by Andy Church.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program (see the file COPYING); if not, write to the
23  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  *
25  *
26  */
27 
28 #include "services.h"
29 #include "timeout.h"
30 #include "version.h"
31 #include "datafiles.h"
32 
33 /******** Global variables! ********/
34 
35 /* Command-line options: (note that configuration variables are in config.c) */
36 char *services_dir = SERVICES_DIR; /* -dir dirname */
37 char *log_filename = LOG_FILENAME; /* -log filename */
38 int debug = 0; /* -debug */
39 int readonly = 0; /* -readonly */
40 int logchan = 0; /* -logchan */
41 int skeleton = 0; /* -skeleton */
42 int nofork = 0; /* -nofork */
43 int forceload = 0; /* -forceload */
44 int nothird = 0; /* -nothrid */
45 int noexpire = 0; /* -noexpire */
46 int protocoldebug = 0; /* -protocoldebug */
47 
48 #ifdef _WIN32
49 char *binary_dir; /* Used to store base path for win32 restart */
50 #endif
51 
52 #ifdef USE_RDB
53 int do_mysql = 0; /* use mysql ? */
54 #endif
55 
56 /* Set to 1 if we are to quit */
57 int quitting = 0;
58 
59 /* Set to 1 if we are to quit after saving databases */
60 int delayed_quit = 0;
61 
62 /* Contains a message as to why services is terminating */
63 char *quitmsg = NULL;
64 
65 /* Input buffer - global, so we can dump it if something goes wrong */
66 char inbuf[BUFSIZE];
67 
68 /* Socket for talking to server */
69 int servsock = -1;
70 
71 /* Should we update the databases now? */
72 int save_data = 0;
73 
74 /* At what time were we started? */
75 time_t start_time;
76 
77 /* Parameters and environment */
78 char **my_av, **my_envp;
79 
80 /* Moved here from version.h */
81 const char version_number[] = VERSION_STRING;
82 const char version_number_dotted[] = VERSION_STRING_DOTTED;
83 const char version_build[] =
84  "build #" BUILD ", compiled " __DATE__ " " __TIME__;
85 /* the space is needed cause if you build with nothing it will complain */
86 const char version_flags[] = " " VER_DEBUG VER_OS VER_MYSQL VER_MODULE;
87 
88 extern char *mod_current_buffer;
89 
90 /******** Local variables! ********/
91 
92 /* Set to 1 if we are waiting for input */
93 static int waiting = 0;
94 
95 /* Set to 1 after we've set everything up */
96 static int started = 0;
97 
98 /*************************************************************************/
99 
100 /* Run expiration routines */
101 
102 extern void expire_all(void)
103 {
104  if (noexpire || readonly)
105  {
106  /* don't allow expiry here or bad things will happen. */
107  return;
108  }
109 
110  waiting = -30;
112  waiting = -3;
113  if (debug)
114  alog("debug: Running expire routines");
115  if (!skeleton) {
116  waiting = -21;
117  expire_nicks();
118  waiting = -22;
119  expire_chans();
120  waiting = -23;
121  expire_requests();
122  }
123  waiting = -25;
124  expire_akills();
125  if (ircd->sgline) {
126  waiting = -26;
127  expire_sglines();
128  }
129  if (ircd->sqline) {
130  waiting = -28;
131  expire_sqlines();
132  }
133  if (ircd->szline) {
134  waiting = -27;
135  expire_szlines();
136  }
137  waiting = -29;
139  waiting = -31;
141 }
142 
143 /*************************************************************************/
144 
145 void save_databases(void)
146 {
147  if (readonly)
148  return;
149  waiting = -19;
151  waiting = -2;
152  if (debug)
153  alog("debug: Saving FFF databases");
154  waiting = -10;
156  if (!skeleton) {
157  waiting = -11;
158  save_ns_dbase();
159  waiting = -12;
160  if (PreNickDBName) {
162  waiting = -13;
163  }
164  save_cs_dbase();
165  if (s_BotServ) {
166  waiting = -14;
167  save_bs_dbase();
168  }
169  if (s_HostServ) {
170  waiting = -15;
171  save_hs_dbase();
172  }
173  }
174  waiting = -16;
175  save_os_dbase();
176  waiting = -17;
177  save_news();
178  waiting = -18;
179  save_exceptions();
180 
181 #ifdef USE_RDB
182  if (do_mysql) {
183  if (debug)
184  alog("debug: Saving RDB databases");
185  waiting = -10;
186  if (!skeleton) {
187  waiting = -11;
189  /* We send these PONG's when we're not syncing to avoid timeouts.
190  * If we send them during the sync, we fuck something up there and
191  * break the syncing process, resulting in lost (literally lost)
192  * data. -GD
193  * This used is_sync(serv_uplink) to check for sync states. There's
194  * only a minor error with this: serv_uplink doesn't exist during
195  * the first save. So now we check for serv_uplink only; if it
196  * exists we're safe. -GD
197  */
198  if (serv_uplink)
200  waiting = -12;
202  if (serv_uplink)
204  if (PreNickDBName) {
206  if (serv_uplink)
208  waiting = -13;
209  }
210  if (s_BotServ) {
211  waiting = -14;
213  if (serv_uplink)
215  }
216  if (s_HostServ) {
217  waiting = -15;
219  if (serv_uplink)
221  }
222  waiting = -16;
224  if (serv_uplink)
226  waiting = -17;
227  save_rdb_news();
228  if (serv_uplink)
230  waiting = -18;
232  if (serv_uplink)
234 
235  } else {
236  alog("!WARNING! Both MySQL and SKELETON are enabled, however SKELETON mode overrides MySQL dumping so databases will NOT be saved to MySQL. Keep this in mind next time you start Anope with UseRDB!");
237  }
238  }
239 #endif
240  waiting = -20;
242 }
243 
244 /*************************************************************************/
245 
246 /* Restarts services */
247 
248 static void services_restart(void)
249 {
250  alog("Restarting");
252  if (!quitmsg)
253  quitmsg = "Restarting";
255  disconn(servsock);
256  close_log();
257  /* First don't unload protocol module, then do so */
258  modules_unload_all(true, false);
259  modules_unload_all(true, true);
260 #ifdef _WIN32
261  /* This fixes bug #589 - change to binary directory for restart */
262  /* -- heinz */
263  if (binary_dir)
264  chdir(binary_dir);
265 #endif
266  execve(SERVICES_BIN, my_av, my_envp);
267  if (!readonly) {
268  open_log();
269  log_perror("Restart failed");
270  close_log();
271  }
272 }
273 
274 /*************************************************************************/
280 {
281  if (!readonly) {
282  expire_all();
283  save_databases();
284  }
286  exit(1);
287 }
288 
289 /*************************************************************************/
290 
291 /* Terminates services */
292 
293 static void services_shutdown(void)
294 {
295  User *u, *next;
296 
298 
299  if (!quitmsg)
300  quitmsg = "Terminating, reason unknown";
301  alog("%s", quitmsg);
302  if (started) {
306  if (ircd->chanmodes) {
308  }
309  u = firstuser();
310  while (u) {
311  next = nextuser();
312  delete_user(u);
313  u = next;
314  }
315  }
317  disconn(servsock);
318  /* First don't unload protocol module, then do so */
319  modules_unload_all(true, false);
320  modules_unload_all(true, true);
321  /* just in case they weren't all removed at least run once */
323 }
324 
325 /*************************************************************************/
326 
327 /* If we get a weird signal, come here. */
328 
329 void sighandler(int signum)
330 {
331  /* We set the quit message to something default, just to be sure it is
332  * always set when we need it. It seems some signals slip through to the
333  * QUIT code without having a valid quitmsg. -GD
334  */
335  quitmsg = "Signal Received";
336  if (started) {
337 #ifndef _WIN32
338  if (signum == SIGHUP) { /* SIGHUP = save databases and restart */
339  signal(SIGHUP, SIG_IGN);
340  signal(SIGUSR2, SIG_IGN);
341  alog("Received SIGHUP, restarting.");
342 
343  expire_all();
344  save_databases();
345 
346  if (!quitmsg)
347  quitmsg = "Restarting on SIGHUP";
348 
349 #ifdef SERVICES_BIN
351  exit(1);
352 #else
353  quitmsg =
354  "Restart attempt failed--SERVICES_BIN not defined (rerun configure)";
355 #endif
356  } else if (signum == SIGQUIT) {
357  /* had to move it to here to make win32 happy */
358  } else if (signum == SIGUSR2) {
359 
360  alog("Received SIGUSR2: Saving Databases & Rehash Configuration");
361 
362  expire_all();
363  save_databases();
364 
365  if (!read_config(1)) {
366  static char *buf = "Error Reading Configuration File (Received SIGUSR2)";
367  quitmsg = buf;
368  quitting = 1;
369  }
371  return;
372 
373  } else
374 #endif
375  if (signum == SIGTERM) {
376  signal(SIGTERM, SIG_IGN);
377 #ifndef _WIN32
378  signal(SIGHUP, SIG_IGN);
379 #endif
380 
381  alog("Received SIGTERM, exiting.");
382 
383  expire_all();
384  save_databases();
385  quitmsg = "Shutting down on SIGTERM";
387  exit(0);
388  } else if (signum == SIGINT) {
389  if (nofork) {
390  signal(SIGINT, SIG_IGN);
391  alog("Received SIGINT, exiting.");
392  expire_all();
393  save_databases();
394  quitmsg = "Shutting down on SIGINT";
396  exit(0);
397  }
398  } else if (!waiting) {
399  alog("PANIC! buffer = %s", inbuf);
400  /* Cut off if this would make IRC command >510 characters. */
401  if (strlen(inbuf) > 448) {
402  inbuf[446] = '>';
403  inbuf[447] = '>';
404  inbuf[448] = 0;
405  }
406  wallops(NULL, "PANIC! buffer = %s\r\n", inbuf);
407  modules_unload_all(false, true);
408  } else if (waiting < 0) {
409  /* This is static on the off-chance we run low on stack */
410  static char buf[BUFSIZE];
411  switch (waiting) {
412  case -1:
413  snprintf(buf, sizeof(buf), "in timed_update");
414  break;
415  case -10:
416  snprintf(buf, sizeof(buf), "backing up databases");
417  break;
418  case -11:
419  snprintf(buf, sizeof(buf), "saving %s", NickDBName);
420  break;
421  case -12:
422  snprintf(buf, sizeof(buf), "saving %s", ChanDBName);
423  break;
424  case -13:
425  snprintf(buf, sizeof(buf), "saving %s", PreNickDBName);
426  break;
427  case -14:
428  snprintf(buf, sizeof(buf), "saving %s", BotDBName);
429  break;
430  case -15:
431  snprintf(buf, sizeof(buf), "saving %s", HostDBName);
432  break;
433  case -16:
434  snprintf(buf, sizeof(buf), "saving %s", OperDBName);
435  break;
436  case -17:
437  snprintf(buf, sizeof(buf), "saving %s", NewsDBName);
438  break;
439  case -18:
440  snprintf(buf, sizeof(buf), "saving %s", ExceptionDBName);
441  break;
442  case -19:
443  snprintf(buf, sizeof(buf), "Sending event %s %s",
445  break;
446  case -20:
447  snprintf(buf, sizeof(buf), "Sending event %s %s",
449  break;
450  case -21:
451  snprintf(buf, sizeof(buf), "expiring nicknames");
452  break;
453  case -22:
454  snprintf(buf, sizeof(buf), "expiring channels");
455  break;
456  case -25:
457  snprintf(buf, sizeof(buf), "expiring autokills");
458  break;
459  case -26:
460  snprintf(buf, sizeof(buf), "expiring SGLINEs");
461  break;
462  case -27:
463  snprintf(buf, sizeof(buf), "expiring SZLINEs");
464  break;
465  case -28:
466  snprintf(buf, sizeof(buf), "expiring SQLINEs");
467  break;
468  case -29:
469  snprintf(buf, sizeof(buf), "expiring Exceptions");
470  break;
471  case -30:
472  snprintf(buf, sizeof(buf), "Sending event %s %s",
474  break;
475  case -31:
476  snprintf(buf, sizeof(buf), "Sending event %s %s",
478  break;
479  default:
480  snprintf(buf, sizeof(buf), "waiting=%d", waiting);
481  }
482  wallops(NULL, "PANIC! %s (%s)", buf, strsignal(signum));
483  alog("PANIC! %s (%s)", buf, strsignal(signum));
484  modules_unload_all(false, true);
485  }
486  }
487 
488  if (
489 #ifndef _WIN32
490  signum == SIGUSR1 ||
491 #endif
492  !(quitmsg = calloc(BUFSIZE, 1))) {
493  quitmsg = "Out of memory!";
494  } else {
495 #if HAVE_STRSIGNAL
496  snprintf(quitmsg, BUFSIZE, "Services terminating: %s",
497  strsignal(signum));
498 #else
499  snprintf(quitmsg, BUFSIZE, "Services terminating on signal %d",
500  signum);
501 #endif
502  }
503 
504  if (signum == SIGSEGV) {
505  do_backtrace(1);
506  modules_unload_all(false, true); /* probably cant do this, but might as well try, we have nothing left to loose */
507  }
508  /* Should we send the signum here as well? -GD */
510 
511  if (started) {
513  exit(0);
514  } else {
515  if (isatty(2)) {
516  fprintf(stderr, "%s\n", quitmsg);
517  } else {
518  alog("%s", quitmsg);
519  }
520  exit(1);
521  }
522 }
523 
524 /*************************************************************************/
525 
526 /* Main routine. (What does it look like? :-) ) */
527 
528 int main(int ac, char **av, char **envp)
529 {
530  volatile time_t last_update; /* When did we last update the databases? */
531  volatile time_t last_expire; /* When did we last expire nicks/channels? */
532  volatile time_t last_check; /* When did we last check timeouts? */
533  volatile time_t last_DefCon; /* When was DefCon last checked? */
534 
535  int i;
536  char *progname;
537 
538  my_av = av;
539  my_envp = envp;
540 
541 #ifndef _WIN32
542  /* If we're root, issue a warning now */
543  if ((getuid() == 0) && (getgid() == 0)) {
544  fprintf(stderr,
545  "WARNING: You are currently running Anope as the root superuser. Anope does not\n");
546  fprintf(stderr,
547  " require root privileges to run, and it is discouraged that you run Anope\n");
548  fprintf(stderr, " as the root superuser.\n");
549  }
550 #else
551  /*
552  * We need to know which directory we're in for when restart is called.
553  * This only affects Windows as a full path is not specified in services_dir.
554  * This fixes bug #589.
555  * -- heinz
556  */
557  binary_dir = smalloc(MAX_PATH);
558  if (!getcwd(binary_dir, MAX_PATH)) {
559  fprintf(stderr, "error: getcwd() error\n");
560  return -1;
561  }
562 #endif
563 
564  /* Clean out the module runtime directory prior to running, just in case files were left behind on a previous run */
566 
567  /* General initialization first */
568  if ((i = init_primary(ac, av)) != 0)
569  return i;
570 
571  /* Find program name. */
572  if ((progname = strrchr(av[0], '/')) != NULL)
573  progname++;
574  else
575  progname = av[0];
576 
577 #ifdef _WIN32
578  if (strcmp(progname, "listnicks.exe") == 0)
579 #else
580  if (strcmp(progname, "listnicks") == 0)
581 #endif
582  {
583  do_listnicks(ac, av);
584  modules_unload_all(1, 0);
585  modules_unload_all(1, 1);
587  return 0;
588  }
589 #ifdef _WIN32
590  else if (strcmp(progname, "listchans.exe") == 0)
591 #else
592  else if (strcmp(progname, "listchans") == 0)
593 #endif
594  {
595  do_listchans(ac, av);
596  modules_unload_all(1, 0);
597  modules_unload_all(1, 1);
599  return 0;
600  }
601 
602  /* Initialization stuff. */
603  if ((i = init_secondary(ac, av)) != 0)
604  return i;
605 
606 
607  /* We have a line left over from earlier, so process it first. */
608  process();
609 
610  /* Set up timers. */
611  last_update = time(NULL);
612  last_expire = time(NULL);
613  last_check = time(NULL);
614  last_DefCon = time(NULL);
615 
616  started = 1;
617 
618  /*** Main loop. ***/
619 
620  while (!quitting) {
621  time_t t = time(NULL);
622 
623  if (debug >= 2)
624  alog("debug: Top of main loop");
625 
626  if (save_data || t - last_expire >= ExpireTimeout) {
627  expire_all();
628  last_expire = t;
629  }
630 
631  if (!readonly && (save_data || t - last_update >= UpdateTimeout)) {
632  if (delayed_quit)
633  anope_cmd_global(NULL,
634  "Updating databases on shutdown, please wait.");
635 
636  save_databases();
637 
638  if (save_data < 0)
639  break; /* out of main loop */
640 
641  save_data = 0;
642  last_update = t;
643  }
644 
645  if ((DefConTimeOut) && (t - last_DefCon >= dotime(DefConTimeOut))) {
646  resetDefCon(5);
647  last_DefCon = t;
648  }
649 
650  if (delayed_quit)
651  break;
652 
654 
655  waiting = -1;
656  if (t - last_check >= TimeoutCheck) {
657  check_timeouts();
658  last_check = t;
659  }
660 
661  waiting = 1;
662  /* this is a nasty nasty typecast. we need to rewrite the
663  socket stuff -Certus */
664  i = (int) (long) sgets2(inbuf, sizeof(inbuf), servsock);
665  waiting = 0;
666  if ((i > 0) || (i < (-1))) {
667  process();
668  } else if (i == 0) {
669  int errno_save = errno;
670  quitmsg = scalloc(BUFSIZE, 1);
671  if (quitmsg) {
673  "Read error from server: %s (error num: %d)",
674  strerror(errno_save), errno_save);
675  } else {
676  quitmsg = "Read error from server";
677  }
678  quitting = 1;
679 
680  /* Save the databases */
681  if (!readonly)
682  save_databases();
683  }
684  waiting = -4;
685  }
686 
687 
688  /* Check for restart instead of exit */
689  if (save_data == -2) {
690 #ifdef SERVICES_BIN
691  alog("Restarting");
692  if (!quitmsg)
693  quitmsg = "Restarting";
695  disconn(servsock);
696  close_log();
697 #ifdef _WIN32
698  /* This fixes bug #589 - change to binary directory for restart */
699  /* -- heinz */
700  if (binary_dir)
701  chdir(binary_dir);
702 #endif
703  execve(SERVICES_BIN, av, envp);
704  if (!readonly) {
705  open_log();
706  log_perror("Restart failed");
707  close_log();
708  }
709  return 1;
710 #else
711  quitmsg =
712  "Restart attempt failed--SERVICES_BIN not defined (rerun configure)";
713 #endif
714  }
715 
716  /* Disconnect and exit */
718 
719 #ifdef _WIN32
720  if (binary_dir)
721  free(binary_dir);
722 #endif
723 
724  return 0;
725 }
726 
727 /*************************************************************************/
728 
729 void do_backtrace(int show_segheader)
730 {
731 #ifndef _WIN32
732 #ifdef HAVE_BACKTRACE
733  void *array[50];
734  size_t size;
735  char **strings;
736  int i;
737 
738  if (show_segheader) {
739  alog("Backtrace: Segmentation fault detected");
740  alog("Backtrace: report the following lines");
741  }
742  alog("Backtrace: Anope version %s %s %s", version_number,
744  size = backtrace(array, 10);
745  strings = backtrace_symbols(array, size);
746  for (i = 0; i < size; i++) {
747  alog("Backtrace(%d): %s", i, strings[i]);
748  }
749  free(strings);
750  alog("Backtrace: complete");
751 #else
752  alog("Backtrace: not available on this platform");
753 #endif
754 #else
755  char *winver;
756  winver = GetWindowsVersion();
757  alog("Backtrace: not available on Windows");
758  alog("Running %S", winver);
759  free(winver);
760 #endif
761 }
E void save_hs_rdb_dbase(void)
Definition: hostserv.c:530
E void save_rdb_exceptions(void)
Definition: sessions.c:478
E void process(void)
Definition: process.c:307
E User * nextuser(void)
Definition: users.c:364
#define Anope_Free(x)
Definition: extern.h:1391
E void delete_user(User *user)
Definition: users.c:195
E char * ExceptionDBName
Definition: extern.h:509
E int init_primary(int ac, char **av)
Definition: init.c:428
char * chanmodes
Definition: services.h:355
int servsock
Definition: main.c:69
E char * DefConTimeOut
Definition: extern.h:566
E void close_log(void)
Definition: log.c:109
int nothird
Definition: main.c:44
static int started
Definition: main.c:96
E int snprintf(char *buf, size_t size, const char *fmt,...)
Definition: compat.c:37
E void save_bs_rdb_dbase(void)
Definition: botserv.c:523
#define EVENT_STOP
Definition: events.h:15
#define EVENT_DB_SAVING
Definition: events.h:17
E void wallops(char *source, const char *fmt,...)
Definition: send.c:327
E void expire_szlines(void)
Definition: operserv.c:1495
E char * s_BotServ
Definition: extern.h:287
E IRCDVar * ircd
Definition: extern.h:39
E void expire_nicks(void)
Definition: nickserv.c:1162
E char * PreNickDBName
Definition: extern.h:333
static int waiting
Definition: main.c:93
E void save_os_dbase(void)
Definition: operserv.c:433
E void expire_sqlines(void)
Definition: operserv.c:1323
E void save_news(void)
Definition: news.c:213
int delayed_quit
Definition: main.c:60
E void send_event(const char *name, int argc,...)
Definition: events.c:37
E char * sgets2(char *buf, int len, ano_socket_t s)
Definition: sockutil.c:451
E void moduleCallBackRun(void)
Definition: modules.c:1848
static void services_shutdown(void)
Definition: main.c:293
E int dotime(const char *s)
Definition: misc.c:364
E char * OperDBName
Definition: extern.h:336
E void save_ns_rdb_dbase(void)
Definition: nickserv.c:873
E char * NickDBName
Definition: extern.h:332
#define EVENT_RELOAD
Definition: events.h:40
E void backup_databases(void)
Definition: datafiles.c:679
E int UpdateTimeout
Definition: extern.h:344
E char * HostDBName
Definition: extern.h:301
char * mod_current_buffer
Definition: modules.c:54
int quitting
Definition: main.c:57
int szline
Definition: services.h:315
int logchan
Definition: main.c:40
E char * NewsDBName
Definition: extern.h:338
#define EVENT_SHUTDOWN
Definition: events.h:41
E void anope_cmd_pong(char *servname, char *who)
Definition: ircd.c:347
const char version_flags[]
Definition: main.c:86
E void * scalloc(long elsize, long els)
Definition: memory.c:55
E void save_cs_rdb_dbase(void)
Definition: chanserv.c:979
int protocoldebug
Definition: main.c:46
void do_restart_services(void)
Definition: main.c:279
const char version_build[]
Definition: main.c:83
E int init_secondary(int ac, char **av)
Definition: init.c:476
E void save_ns_req_dbase(void)
Definition: nickserv.c:846
void check_timeouts(void)
Definition: timeout.c:48
void expire_all(void)
Definition: main.c:102
E void expire_requests(void)
Definition: nickserv.c:1198
int main(int ac, char **av, char **envp)
Definition: main.c:528
E char * uplink
Definition: extern.h:35
time_t start_time
Definition: main.c:75
char ** my_av
Definition: main.c:78
E void expire_exceptions(void)
Definition: sessions.c:328
E int open_log(void)
Definition: log.c:89
int debug
Definition: main.c:38
E void modules_unload_all(boolean fini, boolean unload_proto)
Definition: modules.c:276
E void save_bs_dbase(void)
Definition: botserv.c:491
E void save_hs_dbase(void)
Definition: hostserv.c:504
E char * strerror(int errnum)
Definition: compat.c:123
char * strsignal(int signum)
Definition: compat.c:142
E void alog(const char *fmt,...) FORMAT(printf
int sqline
Definition: services.h:314
char inbuf[BUFSIZE]
Definition: main.c:66
int noexpire
Definition: main.c:45
E int ExpireTimeout
Definition: extern.h:345
E User * firstuser(void)
Definition: users.c:352
#define EVENT_START
Definition: events.h:14
E void anope_cmd_squit(char *servname, char *message)
Definition: ircd.c:529
int nofork
Definition: main.c:42
int readonly
Definition: main.c:39
E void expire_akills(void)
Definition: operserv.c:912
E void disconn(ano_socket_t s)
Definition: sockutil.c:632
E void save_cs_dbase(void)
Definition: chanserv.c:850
#define EVENT_DB_EXPIRE
Definition: events.h:38
E int read_config(int reload)
Definition: config.c:894
E void do_listnicks(int ac, char **av)
Definition: list.c:24
E void save_exceptions(void)
Definition: sessions.c:453
E void save_ns_req_rdb_dbase(void)
Definition: nickserv.c:946
E char * s_HostServ
Definition: extern.h:303
char * log_filename
Definition: main.c:37
E char * ChanDBName
Definition: extern.h:334
void save_databases(void)
Definition: main.c:145
E Server * serv_uplink
Definition: extern.h:1053
int skeleton
Definition: main.c:41
E void ModuleRunTimeDirCleanUp(void)
Definition: modules.c:2880
char * quitmsg
Definition: main.c:63
void do_backtrace(int show_segheader)
Definition: main.c:729
static void services_restart(void)
Definition: main.c:248
int forceload
Definition: main.c:43
E void expire_chans(void)
Definition: chanserv.c:1785
E void save_ns_dbase(void)
Definition: nickserv.c:768
#define EVENT_RESTART
Definition: events.h:39
E void * smalloc(long size)
Definition: memory.c:30
E char * ServerName
Definition: extern.h:274
char ** strings
Definition: langcomp.c:51
void sighandler(int signum)
Definition: main.c:329
char * services_dir
Definition: main.c:36
E void save_rdb_news(void)
Definition: news.c:234
char ** my_envp
Definition: main.c:78
E void do_listchans(int ac, char **av)
Definition: list.c:113
#define EVENT_SIGNAL
Definition: events.h:42
int sgline
Definition: services.h:313
E void E void log_perror(const char *fmt,...) FORMAT(printf
#define LOG_FILENAME
Definition: config.h:28
E void save_os_rdb_dbase(void)
Definition: operserv.c:499
const char version_number[]
Definition: main.c:81
E int TimeoutCheck
Definition: extern.h:348
E char * BotDBName
Definition: extern.h:335
#define BUFSIZE
Definition: config.h:47
int save_data
Definition: main.c:72
E void resetDefCon(int level)
Definition: operserv.c:1616
const char version_number_dotted[]
Definition: main.c:82
E void anope_cmd_global(char *source, const char *fmt,...)
Definition: ircd.c:506
E void expire_sglines(void)
Definition: operserv.c:1103