--- innwebd/service.cpp 2004/07/03 15:10:23 1.2 +++ innwebd/service.cpp 2004/08/10 19:55:57 1.5 @@ -1,10 +1,10 @@ /*******************************************************/ /* */ -/* LeafOK Innd */ +/* LeafOK Innbbsd */ /* Copyright (C) LeafOK.com, 2003-2004 */ /* */ /* Programmed by Leaf */ -/* E-mail:leaf@leafok.com QQ:6049044 */ +/* E-mail:leaflet@leafok.com QQ:6049044 */ /* */ /* http://bbs.leafok.com */ /* http://bbs.leafok.net */ @@ -14,12 +14,15 @@ #include "StdAfx.h" #include ".\service.h" +#include ".\App_common.h" using namespace std; service::service(void) - :CNTService("Innd Service") +:CNTService(App_common::ServiceName) { + this->m_iMajorVersion = App_common::Ver_Major; + this->m_iMinorVersion = App_common::Ver_Minor; } service::~service(void) @@ -32,31 +35,34 @@ void service::Run() this->ctrld.InitThreadPool(); - if (this->ctrld.begin() == 0) + while (this->m_bIsRunning) { - syslog << logfile::log_head << "Begin CONTROL ... OK" << endl; + if (this->ctrld.begin() ==0) + { + syslog << logfile::log_head << "Begin CONTROLD ... OK" << endl; + + this->ctrld.StartupChild(); + + break; + } + syslog << logfile::log_head << "Begin CONTROLD ... Failed" << endl; + Sleep(1000 * 60); } - else - { - syslog << logfile::log_head << "Begin CONTROL ... Failed" << endl; - } - - this->ctrld.StartupChild(); while (this->m_bIsRunning && this->ctrld.IsRunning()) { - Sleep(100); + Sleep(100); } this->ctrld.ShutdownChild(); if (this->ctrld.end() == 0) { - syslog << logfile::log_head << "End CONTROL ... OK" << endl; + syslog << logfile::log_head << "End CONTROLD ... OK" << endl; } else { - syslog << logfile::log_head << "End CONTROL ... Failed" << endl; + syslog << logfile::log_head << "End CONTROLD ... Failed" << endl; } this->ctrld.CleanupThreadPool();