--- innwebd/service.cpp 2004/07/09 00:33:38 1.4 +++ innwebd/service.cpp 2004/09/16 15:42:06 1.6 @@ -31,27 +31,36 @@ service::~service(void) void service::Run() { + int startup_err_count = 0; + this->ctrld.StartupDelay(); this->ctrld.InitThreadPool(); - if (this->ctrld.begin() == 0) + while (this->m_bIsRunning) { - syslog << logfile::log_head << "Begin CONTROLD ... OK" << endl; + if (this->ctrld.begin() == 0) + { + syslog << logfile::log_head << "Begin CONTROLD ... OK" << endl; - this->ctrld.StartupChild(); + this->ctrld.StartupChild(); + + break; + } + syslog << logfile::log_head << "Begin CONTROLD ... Failed" << endl; - while (this->m_bIsRunning && this->ctrld.IsRunning()) - { - Sleep(100); - } + if (startup_err_count++ > 5) + break; - this->ctrld.ShutdownChild(); + Sleep(1000 * 60 * 5); } - else + + while (this->m_bIsRunning && this->ctrld.IsRunning()) { - syslog << logfile::log_head << "Begin CONTROLD ... Failed" << endl; - } + Sleep(100); + } + + this->ctrld.ShutdownChild(); if (this->ctrld.end() == 0) {