diff options
author | Adam <Adam@anope.org> | 2012-10-22 00:54:30 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-10-22 00:54:30 -0400 |
commit | 0b9db15efc322336ddb08671ce68a3d45fb22520 (patch) | |
tree | 2e8149f370c63f08f2f197eaa92b1b36e857b0e9 /src/init.cpp | |
parent | d5b2f9cfa78ed176ffe1d9f2923799fdd37217a5 (diff) |
Add os_dns, a way to control your DNS zone via services
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp index 4f0f8bac3..c2c44ec16 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -422,6 +422,9 @@ void Init(int ac, char **av) Log(LOG_TERMINAL) << "Using configuration file " << conf_dir << "/" << services_conf.GetName(); #endif + /* Initialize the socket engine */ + SocketEngine::Init(); + /* Read configuration file; exit if there are problems. */ try { @@ -441,6 +444,15 @@ void Init(int ac, char **av) if (!SupportedWindowsVersion()) throw FatalException(GetWindowsVersion() + " is not a supported version of Windows"); #else + /* If we're root, issue a warning now */ + if (!getuid() && !getgid()) + { + std::cerr << "WARNING: You are currently running Anope as the root superuser. Anope does not" << std::endl; + std::cerr << " require root privileges to run, and it is discouraged that you run Anope" << std::endl; + std::cerr << " as the root superuser." << std::endl; + sleep(3); + } + if (!nofork && AtTerm()) { /* Install these before fork() - it is possible for the child to @@ -478,16 +490,16 @@ void Init(int ac, char **av) } #endif - /* Initialize the socket engine */ - SocketEngine::Init(); - /* Write our PID to the PID file. */ write_pidfile(); /* Create me */ Me = new Server(NULL, Config->ServerName, 0, Config->ServerDesc, Config->Numeric); for (botinfo_map::const_iterator it = BotListByNick->begin(), it_end = BotListByNick->end(); it != it_end; ++it) + { it->second->server = Me; + ++Me->Users; + } /* Announce ourselves to the logfile. */ Log() << "Anope " << Anope::Version() << " starting up" << (debug || readonly ? " (options:" : "") << (debug ? " debug" : "") << (readonly ? " readonly" : "") << (debug || readonly ? ")" : ""); |