From 6bb948ae948778077df154ac5c3e8ec9e91e031b Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 18 Apr 2005 13:14:11 +0000 Subject: Added PID reporting and testing before daemonize git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1120 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 12 +++++++----- src/inspircd_io.cpp | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/inspircd.cpp b/src/inspircd.cpp index a1e294696..2c67995e3 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -463,7 +463,7 @@ void ReadConfig(bool bail, userrec* user) read_xline_defaults(); log(DEFAULT,"Applying K lines, Q lines and Z lines..."); apply_lines(); - log(DEFAULT,"Done reading configuration file, InspIRCd is now running."); + log(DEFAULT,"Done reading configuration file, InspIRCd is now starting."); if (!bail) { log(DEFAULT,"Adding and removing modules due to rehash..."); @@ -3684,7 +3684,7 @@ int InspIRCd(void) if (!me[count3]->CreateListener(Addr,atoi(configToken))) { log(DEFAULT,"Warning: Failed to bind port %d",atoi(configToken)); - printf("Warning: Failed to bind port %d",atoi(configToken)); + printf("Warning: Failed to bind port %d\n",atoi(configToken)); } else { @@ -3716,7 +3716,7 @@ int InspIRCd(void) if (!LoadModule(configToken)) { log(DEBUG,"Exiting due to a module loader error."); - printf("There was an error loading a module: %s\n",ModuleError()); + printf("\nThere was an error loading a module: %s\n",ModuleError()); Exit(0); } } @@ -3726,9 +3726,9 @@ int InspIRCd(void) char PID[MAXBUF]; ConfValue("pid","file",0,PID,&config_f); + // write once here, to try it out and make sure its ok WritePID(PID); - /* setup select call */ FD_ZERO(&selectFds); log(DEBUG,"InspIRCd: startup: zero selects"); @@ -3757,7 +3757,7 @@ int InspIRCd(void) if (boundPortCount == 0) { log(DEFAULT,"InspIRCd: startup: no ports bound, bailing!"); - printf("ERROR: Was not able to bind any of %d ports! Please check your configuration.\r\n", portCount); + printf("\nERROR: Was not able to bind any of %d ports! Please check your configuration.\n\n", portCount); return (ERROR); } @@ -3778,6 +3778,8 @@ int InspIRCd(void) } } + WritePID(PID); + length = sizeof (client); char udp_msg[MAXBUF], tcp_host[MAXBUF]; diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp index 523af8eb1..79e912175 100644 --- a/src/inspircd_io.cpp +++ b/src/inspircd_io.cpp @@ -109,6 +109,7 @@ int DaemonSeed (void) exit (0); setsid (); umask (007); + printf("InspIRCd PID: %d\n",getpid()); /* close stdin, stdout, stderr */ freopen("/dev/null","w",stdout); freopen("/dev/null","w",stderr); -- cgit v1.2.3