1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
14 /* w00t was here. ;p */
16 /* $Install: src/inspircd $(BINPATH) */
23 #include <sys/resource.h>
27 /* Some systems don't define RUSAGE_SELF. This should fix them. */
32 /* CRT memory debugging */
34 #define _CRTDBG_MAP_ALLOC
39 #include <pwd.h> // setuid
40 #include <grp.h> // setgid
46 #include "socketengine.h"
47 #include "inspircd_se_config.h"
49 #include "command_parse.h"
50 #include "exitcodes.h"
52 #include "testsuite.h"
57 /** Seperate from the other casemap tables so that code *can* still exclusively rely on RFC casemapping
60 * This is provided as a pointer so that modules can change it to their custom mapping tables,
61 * e.g. for national character support.
63 unsigned const char *national_case_insensitive_map = rfc_case_insensitive_map;
66 /* Moved from exitcodes.h -- due to duplicate symbols -- Burlex
67 * XXX this is a bit ugly. -- w00t
69 const char* ExitCodes[] =
72 "DIE command", /* 1 */
73 "execv() failed", /* 2 */
74 "Internal error", /* 3 */
75 "Config file error", /* 4 */
76 "Logfile error", /* 5 */
77 "POSIX fork failed", /* 6 */
78 "Bad commandline parameters", /* 7 */
79 "No ports could be bound", /* 8 */
80 "Can't write PID file", /* 9 */
81 "SocketEngine could not initialize", /* 10 */
82 "Refusing to start up as root", /* 11 */
83 "Found a <die> tag!", /* 12 */
84 "Couldn't load module on startup", /* 13 */
85 "Could not create windows forked process", /* 14 */
86 "Received SIGTERM", /* 15 */
87 "Bad command handler loaded", /* 16 */
88 "RegisterServiceCtrlHandler failed", /* 17 */
89 "UpdateSCMStatus failed", /* 18 */
90 "CreateEvent failed" /* 19 */
93 template<typename T> void DeleteZero(T* n)
102 void InspIRCd::Cleanup()
106 for (unsigned int i = 0; i < Config->ports.size(); i++)
108 /* This calls the constructor and closes the listening socket */
109 delete Config->ports[i];
112 Config->ports.clear();
115 /* Close all client sockets, or the new process inherits them */
116 for (std::vector<User*>::const_iterator i = this->Users->local_users.begin(); i != this->Users->local_users.end(); i++)
118 this->Users->QuitUser((*i), "Server shutdown");
122 /* We do this more than once, so that any service providers get a
123 * chance to be unhooked by the modules using them, but then get
124 * a chance to be removed themsleves.
126 * XXX there may be a better way to do this with 1.2
128 for (int tries = 0; tries < 3; tries++)
130 std::vector<std::string> module_names = Modules->GetAllModuleNames(0);
131 for (std::vector<std::string>::iterator k = module_names.begin(); k != module_names.end(); ++k)
133 /* Unload all modules, so they get a chance to clean up their listeners */
134 this->Modules->Unload(k->c_str());
137 /* Remove core commands */
138 Parser->RemoveCommands("<core>");
140 /* Cleanup Server Names */
141 for(servernamelist::iterator itr = servernames.begin(); itr != servernames.end(); ++itr)
144 /* Delete objects dynamically allocated in constructor (destructor would be more appropriate, but we're likely exiting) */
145 /* Must be deleted before modes as it decrements modelines */
146 DeleteZero(this->Users);
147 DeleteZero(this->Modes);
148 DeleteZero(this->XLines);
149 DeleteZero(this->Parser);
150 DeleteZero(this->stats);
151 DeleteZero(this->Modules);
152 DeleteZero(this->BanCache);
153 DeleteZero(this->SNO);
154 DeleteZero(this->Config);
155 DeleteZero(this->Res);
156 DeleteZero(this->chanlist);
157 DeleteZero(this->PI);
158 DeleteZero(this->Threads);
159 DeleteZero(this->Timers);
161 this->Logs->CloseLogs();
162 DeleteZero(this->Logs);
164 delete RehashFinishMutex;
167 void InspIRCd::Restart(const std::string &reason)
169 /* SendError flushes each client's queue,
170 * regardless of writeability state
172 this->SendError(reason);
174 /* Figure out our filename (if theyve renamed it, we're boned) */
178 char module[MAX_PATH];
179 if (GetModuleFileName(NULL, module, MAX_PATH))
182 me = Config->MyDir + "/inspircd";
185 char** argv = Config->argv;
189 if (execv(me.c_str(), argv) == -1)
191 /* Will raise a SIGABRT if not trapped */
192 throw CoreException(std::string("Failed to execv()! error: ") + strerror(errno));
196 void InspIRCd::ResetMaxBans()
198 for (chan_hash::const_iterator i = chanlist->begin(); i != chanlist->end(); i++)
199 i->second->ResetMaxBans();
202 /** Because hash_map doesnt free its buckets when we delete items (this is a 'feature')
203 * we must occasionally rehash the hash (yes really).
204 * We do this by copying the entries from the old hash to a new hash, causing all
205 * empty buckets to be weeded out of the hash. We dont do this on a timer, as its
206 * very expensive, so instead we do it when the user types /REHASH and expects a
207 * short delay anyway.
209 void InspIRCd::RehashUsersAndChans()
211 user_hash* old_users = this->Users->clientlist;
212 user_hash* old_uuid = this->Users->uuidlist;
213 chan_hash* old_chans = this->chanlist;
215 this->Users->clientlist = new user_hash();
216 this->Users->uuidlist = new user_hash();
217 this->chanlist = new chan_hash();
219 for (user_hash::const_iterator n = old_users->begin(); n != old_users->end(); n++)
220 this->Users->clientlist->insert(*n);
224 for (user_hash::const_iterator n = old_uuid->begin(); n != old_uuid->end(); n++)
225 this->Users->uuidlist->insert(*n);
229 for (chan_hash::const_iterator n = old_chans->begin(); n != old_chans->end(); n++)
230 this->chanlist->insert(*n);
235 void InspIRCd::SetSignals()
238 signal(SIGALRM, SIG_IGN);
239 signal(SIGHUP, InspIRCd::SetSignal);
240 signal(SIGPIPE, SIG_IGN);
241 signal(SIGCHLD, SIG_IGN);
243 signal(SIGTERM, InspIRCd::SetSignal);
246 void InspIRCd::QuickExit(int status)
251 bool InspIRCd::DaemonSeed()
254 printf_c("InspIRCd Process ID: \033[1;32m%lu\033[0m\n", GetCurrentProcessId());
257 signal(SIGTERM, InspIRCd::QuickExit);
260 if ((childpid = fork ()) < 0)
262 else if (childpid > 0)
264 /* We wait here for the child process to kill us,
265 * so that the shell prompt doesnt come back over
267 * Sending a kill with a signal of 0 just checks
268 * if the child pid is still around. If theyre not,
269 * they threw an error and we should give up.
271 while (kill(childpid, 0) != -1)
277 printf("InspIRCd Process ID: \033[1;32m%lu\033[0m\n",(unsigned long)getpid());
279 signal(SIGTERM, InspIRCd::SetSignal);
282 if (getrlimit(RLIMIT_CORE, &rl) == -1)
284 this->Logs->Log("STARTUP",DEFAULT,"Failed to getrlimit()!");
289 rl.rlim_cur = rl.rlim_max;
290 if (setrlimit(RLIMIT_CORE, &rl) == -1)
291 this->Logs->Log("STARTUP",DEFAULT,"setrlimit() failed, cannot increase coredump size.");
298 void InspIRCd::WritePID(const std::string &filename)
300 std::string fname = (filename.empty() ? "inspircd.pid" : filename);
301 std::replace(fname.begin(), fname.end(), '\\', '/');
302 if ((fname[0] != '/') && (!Config->StartsWithWindowsDriveLetter(filename)))
304 std::string::size_type pos;
305 std::string confpath = this->ConfigFileName;
306 if ((pos = confpath.rfind("/")) != std::string::npos)
308 /* Leaves us with just the path */
309 fname = confpath.substr(0, pos) + std::string("/") + fname;
312 std::ofstream outfile(fname.c_str());
313 if (outfile.is_open())
320 printf("Failed to write PID-file '%s', exiting.\n",fname.c_str());
321 this->Logs->Log("STARTUP",DEFAULT,"Failed to write PID-file '%s', exiting.",fname.c_str());
322 Exit(EXIT_STATUS_PID);
326 InspIRCd::InspIRCd(int argc, char** argv)
329 /* Functor initialisation. Note that the ordering here is very important.
331 * THIS MUST MATCH ORDER OF DECLARATION OF THE HandleWhateverFunc classes
332 * within class InspIRCd.
334 HandleProcessUser(this),
337 HandleFindDescriptor(this),
338 HandleFloodQuitUser(this),
339 HandleIsChannel(this),
343 /* Functor pointer initialisation. Must match the order of the list above
345 * THIS MUST MATCH THE ORDER OF DECLARATION OF THE FUNCTORS, e.g. the methods
346 * themselves within the class.
348 ProcessUser(&HandleProcessUser),
349 IsChannel(&HandleIsChannel),
351 Rehash(&HandleRehash),
352 IsNick(&HandleIsNick),
353 IsIdent(&HandleIsIdent),
354 FindDescriptor(&HandleFindDescriptor),
355 FloodQuitUser(&HandleFloodQuitUser)
359 // Strict, frequent checking of memory on debug builds
360 _CrtSetDbgFlag ( _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
362 // Avoid erroneous frees on early exit
367 int do_version = 0, do_nofork = 0, do_debug = 0,
368 do_nolog = 0, do_root = 0, do_testsuite = 0; /* flag variables */
371 // Initialize so that if we exit before proper initialization they're not deleted
389 this->TIME = time(NULL);
391 memset(&server, 0, sizeof(server));
392 memset(&client, 0, sizeof(client));
394 // This must be created first, so other parts of Insp can use it while starting up
395 this->Logs = new LogManager(this);
397 SocketEngineFactory* SEF = new SocketEngineFactory();
398 SE = SEF->Create(this);
401 ThreadEngineFactory* tef = new ThreadEngineFactory();
402 this->Threads = tef->Create(this);
404 this->Mutexes = new MutexFactory(this);
406 /* Default implementation does nothing */
407 this->PI = new ProtocolInterface(this);
411 // Create base manager classes early, so nothing breaks
412 this->Users = new UserManager(this);
414 this->Users->unregistered_count = 0;
416 this->Users->clientlist = new user_hash();
417 this->Users->uuidlist = new user_hash();
418 this->chanlist = new chan_hash();
420 this->Config = new ServerConfig(this);
421 this->SNO = new SnomaskManager(this);
422 this->BanCache = new BanCacheManager(this);
423 this->Modules = new ModuleManager(this);
424 this->stats = new serverstats();
425 this->Timers = new TimerManager(this);
426 this->Parser = new CommandParser(this);
427 this->XLines = new XLineManager(this);
429 this->Config->argv = argv;
430 this->Config->argc = argc;
432 if (chdir(Config->GetFullProgDir().c_str()))
434 printf("Unable to change to my directory: %s\nAborted.", strerror(errno));
438 this->Config->opertypes.clear();
439 this->Config->operclass.clear();
441 this->TIME = this->OLDTIME = this->startup_time = time(NULL);
444 *this->LogFileName = 0;
445 strlcpy(this->ConfigFileName, CONFIG_FILE, MAXBUF);
447 struct option longopts[] =
449 { "nofork", no_argument, &do_nofork, 1 },
450 { "logfile", required_argument, NULL, 'f' },
451 { "config", required_argument, NULL, 'c' },
452 { "debug", no_argument, &do_debug, 1 },
453 { "nolog", no_argument, &do_nolog, 1 },
454 { "runasroot", no_argument, &do_root, 1 },
455 { "version", no_argument, &do_version, 1 },
456 { "testsuite", no_argument, &do_testsuite, 1 },
460 while ((c = getopt_long_only(argc, argv, ":f:", longopts, NULL)) != -1)
465 /* Log filename was set */
466 strlcpy(LogFileName, optarg, MAXBUF);
469 /* Config filename was set */
470 strlcpy(ConfigFileName, optarg, MAXBUF);
473 /* getopt_long_only() set an int variable, just keep going */
476 /* Unknown parameter! DANGER, INTRUDER.... err.... yeah. */
477 printf("Usage: %s [--nofork] [--nolog] [--debug] [--logfile <filename>]\n\
478 [--runasroot] [--version] [--config <config>] [--testsuite]\n", argv[0]);
479 Exit(EXIT_STATUS_ARGV);
485 do_nofork = do_debug = true;
489 printf("\n%s r%s\n", VERSION, REVISION);
490 Exit(EXIT_STATUS_NOERROR);
498 DWORD ExitCode = WindowsForkStart(this);
505 WSAStartup(MAKEWORD(2,0), &wsadata);
506 ChangeWindowsSpecificPointers(this);
508 strlcpy(Config->MyExecutable,argv[0],MAXBUF);
510 /* Set the finished argument values */
511 Config->nofork = do_nofork;
512 Config->forcedebug = do_debug;
513 Config->writelog = !do_nolog;
514 Config->TestSuite = do_testsuite;
516 if (!this->OpenLog(argv, argc))
518 printf("ERROR: Could not open logfile %s: %s\n\n", Config->logpath.c_str(), strerror(errno));
519 Exit(EXIT_STATUS_LOG);
522 if (!ServerConfig::FileExists(this->ConfigFileName))
525 /* Windows can (and defaults to) hide file extensions, so let's play a bit nice for windows users. */
526 if (ServerConfig::FileExists(this->ConfigFileName + ".txt"))
528 strlcat(this->ConfigFileName, ".txt", MAXBUF);
533 printf("ERROR: Cannot open config file: %s\nExiting...\n", this->ConfigFileName);
534 this->Logs->Log("STARTUP",DEFAULT,"Unable to open config file %s", this->ConfigFileName);
535 Exit(EXIT_STATUS_CONFIG);
539 printf_c("\033[1;32mInspire Internet Relay Chat Server, compiled %s at %s\n",__DATE__,__TIME__);
540 printf_c("(C) InspIRCd Development Team.\033[0m\n\n");
541 printf_c("Developers:\n");
542 printf_c("\t\033[1;32mBrain, FrostyCoolSlug, w00t, Om, Special\n");
543 printf_c("\t\033[1;32mpippijn, peavey, aquanight, fez, psychon, dz\033[0m\n\n");
544 printf_c("Others:\t\t\t\033[1;32mSee /INFO Output\033[0m\n");
546 Config->ClearStack();
548 this->Modes = new ModeParser(this);
554 printf("* WARNING * WARNING * WARNING * WARNING * WARNING * \n\n");
555 printf("YOU ARE RUNNING INSPIRCD AS ROOT. THIS IS UNSUPPORTED\n");
556 printf("AND IF YOU ARE HACKED, CRACKED, SPINDLED OR MUTILATED\n");
557 printf("OR ANYTHING ELSE UNEXPECTED HAPPENS TO YOU OR YOUR\n");
558 printf("SERVER, THEN IT IS YOUR OWN FAULT. IF YOU DID NOT MEAN\n");
559 printf("TO START INSPIRCD AS ROOT, HIT CTRL+C NOW AND RESTART\n");
560 printf("THE PROGRAM AS A NORMAL USER. YOU HAVE BEEN WARNED!\n");
561 printf("\nInspIRCd starting in 20 seconds, ctrl+c to abort...\n");
569 if (!this->DaemonSeed())
571 printf("ERROR: could not go into daemon mode. Shutting down.\n");
572 Logs->Log("STARTUP", DEFAULT, "ERROR: could not go into daemon mode. Shutting down.");
573 Exit(EXIT_STATUS_FORK);
577 SE->RecoverFromFork();
579 /* During startup we don't actually initialize this
580 * in the thread engine.
582 this->ConfigThread = new ConfigReaderThread(this, true, "");
585 this->ConfigThread = NULL;
586 /* Switch over logfiles */
587 Logs->OpenFileLogs();
589 /** Note: This is safe, the method checks for user == NULL */
590 this->Parser->SetupCommandTable();
592 this->Res = new DNS(this);
594 this->AddServerName(Config->ServerName);
597 * Initialise SID/UID.
598 * For an explanation as to exactly how this works, and why it works this way, see GetUID().
606 for (const char* x = Config->ServerName; *x; ++x)
608 for (const char* y = Config->ServerDesc; *y; ++y)
612 Config->sid[0] = (char)(sid / 100 + 48);
613 Config->sid[1] = (char)(((sid / 10) % 10) + 48);
614 Config->sid[2] = (char)(sid % 10 + 48);
615 Config->sid[3] = '\0';
618 /* set up fake client again this time with the correct uid */
619 this->FakeClient = new User(this, "#INVALID");
620 this->FakeClient->SetFd(FD_MAGIC_NUMBER);
622 // Get XLine to do it's thing.
623 this->XLines->CheckELines();
624 this->XLines->ApplyLines();
627 int bounditems = BindPorts(true, found_ports, pl);
631 this->Modules->LoadAll();
633 /* Just in case no modules were loaded - fix for bug #101 */
634 this->BuildISupport();
635 InitializeDisabledCommands(Config->DisabledCommands, this);
637 if (Config->ports.size() != (unsigned int)found_ports)
639 printf("\nWARNING: Not all your client ports could be bound --\nstarting anyway with %d of %d client ports bound.\n\n", bounditems, found_ports);
640 printf("The following port(s) failed to bind:\n");
641 printf("Hint: Try using a public IP instead of blank or *\n\n");
643 for (FailedPortList::iterator i = pl.begin(); i != pl.end(); i++, j++)
645 printf("%d.\tAddress: %s\tReason: %s\n", j, i->first.empty() ? "<all>" : i->first.c_str(), i->second.c_str());
649 printf("\nInspIRCd is now running as '%s'[%s] with %d max open sockets\n", Config->ServerName,Config->GetSID().c_str(), SE->GetMaxFds());
654 if (kill(getppid(), SIGTERM) == -1)
656 printf("Error killing parent process: %s\n",strerror(errno));
657 Logs->Log("STARTUP", DEFAULT, "Error killing parent process: %s",strerror(errno));
661 if (isatty(0) && isatty(1) && isatty(2))
663 /* We didn't start from a TTY, we must have started from a background process -
664 * e.g. we are restarting, or being launched by cron. Dont kill parent, and dont
667 if ((!do_nofork) && (!do_testsuite))
675 Logs->Log("STARTUP", DEFAULT,"Keeping pseudo-tty open as we are running in the foreground.");
679 WindowsIPC = new IPC(this);
682 WindowsForkKillOwner(this);
685 /* Set win32 service as running, if we are running as a service */
689 Logs->Log("STARTUP", DEFAULT, "Startup complete as '%s'[%s], %d max open sockets", Config->ServerName,Config->GetSID().c_str(), SE->GetMaxFds());
692 if (*(this->Config->SetGroup))
697 ret = setgroups(0, NULL);
701 this->Logs->Log("SETGROUPS", DEFAULT, "setgroups() failed (wtf?): %s", strerror(errno));
709 g = getgrnam(this->Config->SetGroup);
713 this->Logs->Log("SETGUID", DEFAULT, "getgrnam() failed (bad user?): %s", strerror(errno));
717 ret = setgid(g->gr_gid);
721 this->Logs->Log("SETGUID", DEFAULT, "setgid() failed (bad user?): %s", strerror(errno));
726 if (*(this->Config->SetUser))
732 u = getpwnam(this->Config->SetUser);
736 this->Logs->Log("SETGUID", DEFAULT, "getpwnam() failed (bad user?): %s", strerror(errno));
740 int ret = setuid(u->pw_uid);
744 this->Logs->Log("SETGUID", DEFAULT, "setuid() failed (bad user?): %s", strerror(errno));
750 this->WritePID(Config->PID);
755 /* See if we're supposed to be running the test suite rather than entering the mainloop */
756 if (Config->TestSuite)
758 TestSuite* ts = new TestSuite(this);
763 RehashFinishMutex = Mutexes->CreateMutex();
770 static time_t uptime;
771 static struct tm * stime;
772 static char window_title[100];
775 /* Check if there is a config thread which has finished executing but has not yet been freed */
776 RehashFinishMutex->Lock();
777 if (this->ConfigThread && this->ConfigThread->GetExitFlag())
779 /* Rehash has completed */
781 /* Switch over logfiles */
783 Logs->OpenFileLogs();
785 this->Logs->Log("CONFIG",DEBUG,"Detected ConfigThread exiting, tidying up...");
787 /* These are currently not known to be threadsafe, so they are executed outside
788 * of the thread. It would be pretty simple to move them to the thread Run method
789 * once they are known threadsafe with all the correct mutexes in place. This might
790 * not be worth the effort however as these functions execute relatively quickly
791 * and would not benefit from being within the config read thread.
793 * XXX: The order of these is IMPORTANT, do not reorder them without testing
796 this->XLines->CheckELines();
797 this->XLines->ApplyLines();
799 this->ResetMaxBans();
800 InitializeDisabledCommands(Config->DisabledCommands, this);
801 User* user = !Config->RehashUserUID.empty() ? FindNick(Config->RehashUserUID) : NULL;
802 FOREACH_MOD_I(this, I_OnRehash, OnRehash(user, Config->RehashParameter));
803 this->BuildISupport();
805 /* IMPORTANT: This delete may hang if you fuck up your thread syncronization.
806 * It will hang waiting for the ConfigThread to 'join' to avoid race conditons,
807 * until the other thread is completed.
812 RehashFinishMutex->Unlock();
814 /* time() seems to be a pretty expensive syscall, so avoid calling it too much.
815 * Once per loop iteration is pleanty.
820 /* Run background module timers every few seconds
821 * (the docs say modules shouldnt rely on accurate
822 * timing using this event, so we dont have to
823 * time this exactly).
827 /* Allow a buffer of two seconds drift on this so that ntpdate etc dont harass admins */
828 if (TIME < OLDTIME - 2)
830 SNO->WriteToSnoMask('d', "\002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %lu secs.", (unsigned long)OLDTIME-TIME);
832 else if (TIME > OLDTIME + 2)
834 SNO->WriteToSnoMask('d', "\002EH?!\002 -- Time is jumping FORWARDS! Clock skipped %lu secs.", (unsigned long)TIME - OLDTIME);
837 if ((TIME % 3600) == 0)
839 this->RehashUsersAndChans();
840 FOREACH_MOD_I(this, I_OnGarbageCollect, OnGarbageCollect());
843 Timers->TickTimers(TIME);
844 this->DoBackgroundUserStuff();
848 FOREACH_MOD_I(this,I_OnBackgroundTimer,OnBackgroundTimer(TIME));
849 SNO->FlushSnotices();
852 /* Same change as in cmd_stats.cpp, use RUSAGE_SELF rather than '0' -- Om */
853 if (!getrusage(RUSAGE_SELF, &ru))
855 gettimeofday(&this->stats->LastSampled, NULL);
856 this->stats->LastCPU = ru.ru_utime;
863 /* Call the socket engine to wait on the active
864 * file descriptors. The socket engine has everything's
865 * descriptors in its list... dns, modules, users,
866 * servers... so its nice and easy, just one call.
867 * This will cause any read or write events to be
868 * dispatched to their handlers.
870 this->SE->DispatchEvents();
872 /* if any users were quit, take them out */
873 this->GlobalCulls.Apply();
875 /* If any inspsockets closed, remove them */
876 this->BufferedSocketCull();
880 this->SignalHandler(s_signal);
888 void InspIRCd::BufferedSocketCull()
890 for (std::map<BufferedSocket*,BufferedSocket*>::iterator x = SocketCull.begin(); x != SocketCull.end(); ++x)
892 this->Logs->Log("MISC",DEBUG,"Cull socket");
893 SE->DelFd(x->second);
900 /**********************************************************************************/
903 * An ircd in five lines! bwahahaha. ahahahahaha. ahahah *cough*.
906 /* this returns true when all modules are satisfied that the user should be allowed onto the irc server
907 * (until this returns true, a user will block in the waiting state, waiting to connect up to the
908 * registration timeout maximum seconds)
910 bool InspIRCd::AllModulesReportReady(User* user)
912 for (EventHandlerIter i = Modules->EventHandlers[I_OnCheckReady].begin(); i != Modules->EventHandlers[I_OnCheckReady].end(); ++i)
914 if (!(*i)->OnCheckReady(user))
920 time_t InspIRCd::Time()
925 void InspIRCd::SetSignal(int signal)
930 /* On posix systems, the flow of the program starts right here, with
931 * ENTRYPOINT being a #define that defines main(). On Windows, ENTRYPOINT
932 * defines smain() and the real main() is in the service code under
933 * win32service.cpp. This allows the service control manager to control
934 * the process where we are running as a windows service.
938 SI = new InspIRCd(argc, argv);
939 mysig = &SI->s_signal;