]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Added -nofork parameter which allows you to force inspircd into the foreground for...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 3 Apr 2004 00:33:52 +0000 (00:33 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 3 Apr 2004 00:33:52 +0000 (00:33 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@360 e03df62e-2008-0410-955e-edbf42e46eb7

src/InspIRCd.layout
src/inspircd.cpp

index fc603480556fcd13f20be9af7598ad73d097270e..b762b74809c279a0e86bc8aba4982365e446fb51 100644 (file)
@@ -1,6 +1,6 @@
 [Editors]
 Focused=1
-Order=1,7,3,2,0,6,5,4,25,24,-1
+Order=7,3,2,0,6,5,4,25,24,-1,1
 
 [Editor_0]
 Open=1
@@ -13,9 +13,9 @@ LeftChar=1
 [Editor_1]
 Open=1
 Top=1
-CursorCol=1
-CursorRow=3257
-TopLine=3234
+CursorCol=14
+CursorRow=2883
+TopLine=2857
 LeftChar=1
 
 [Editor_2]
@@ -83,7 +83,7 @@ TopLine=1
 LeftChar=1
 
 [Editor_10]
-Open=1
+Open=0
 Top=0
 CursorCol=1
 CursorRow=1
@@ -155,7 +155,7 @@ TopLine=1
 LeftChar=1
 
 [Editor_19]
-Open=1
+Open=0
 Top=0
 CursorCol=1
 CursorRow=1
index 062a07995cceba6fafcd03cb695f414be3ec0557..44428783409ff7d7670c3c53afefcf8766b09714 100644 (file)
@@ -81,6 +81,8 @@ vector<int> fd_reap;
 
 extern int MODCOUNT;
 
+bool nofork = false;
+
 namespace nspace
 {
        template<> struct nspace::hash<in_addr>
@@ -279,6 +281,11 @@ void log(int level,char *text, ...)
                b[strlen(b)-1] = ':';
                fprintf(f,"%s %s\n",b,textbuffer);
                fclose(f);
+               if (nofork)
+               {
+                       // nofork enabled? display it on terminal too
+                       printf("%s %s\n",b,textbuffer);
+               }
        }
        else
        {
@@ -2873,6 +2880,11 @@ int main (int argc, char *argv[])
                printf("ERROR: Your config file is missing, this IRCd will self destruct in 10 seconds!\n");
                Exit(ERROR);
        }
+       if (argc > 1) {
+               if (!strcmp(argv[1],"-nofork")) {
+                       nofork = true;
+               }
+       }
        if (InspIRCd() == ERROR)
        {
                log(DEBUG,"main: daemon function bailed");
@@ -4601,11 +4613,18 @@ int InspIRCd(void)
 
   startup_time = time(NULL);
   
-  if (DaemonSeed() == ERROR)
+  if (nofork)
   {
-     log(DEBUG,"InspIRCd: startup: can't daemonise");
-     printf("ERROR: could not go into daemon mode. Shutting down.\n");
-     Exit(ERROR);
+       log(VERBOSE,"Not forking as -nofork was specified");
+  }
+  else
+  {
+       if (DaemonSeed() == ERROR)
+       {
+               log(DEBUG,"InspIRCd: startup: can't daemonise");
+               printf("ERROR: could not go into daemon mode. Shutting down.\n");
+               Exit(ERROR);
+       }
   }