diff options
author | Michał Zegan <webczat_200@poczta.onet.pl> | 2014-12-12 19:46:20 +0100 |
---|---|---|
committer | Michał Zegan <webczat_200@poczta.onet.pl> | 2014-12-12 19:53:30 +0100 |
commit | e4068249dd2ba4f198c7ef0117743896248769a4 (patch) | |
tree | fdfb27e2f3e841e158164d2b75b8d3a7640241d9 /src/init.cpp | |
parent | 7213413f8b5c68a99f769facb93acfc3fc4ceb4e (diff) |
Anope will now fork even when not started from a tty, like init scrpits.
It is useful for init systems or startup scripts, because it allows easily waiting until services connect to the uplink, without them forking it wouldn't be possible to tell if they finished initialization or not unless they would communicate directly with init systems like systemd.
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp index 8f479f73e..e6bc8e150 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -440,7 +440,7 @@ void Anope::Init(int ac, char **av) Log(LOG_TERMINAL) << "Using configuration file " << Anope::ConfigDir << "/" << ServicesConf.GetName(); /* Fork to background */ - if (!Anope::NoFork && Anope::AtTerm()) + if (!Anope::NoFork) { /* Install these before fork() - it is possible for the child to * connect and kill() the parent before it is able to install the @@ -524,7 +524,7 @@ void Anope::Init(int ac, char **av) #ifndef _WIN32 /* We won't background later, so we should setuid now */ - if (Anope::NoFork || !Anope::AtTerm()) + if (Anope::NoFork) setuidgid(); #endif |