| 31 |
|
|
| 32 |
void service::Run() |
void service::Run() |
| 33 |
{ |
{ |
| 34 |
|
int startup_err_count = 0; |
| 35 |
|
|
| 36 |
this->ctrld.StartupDelay(); |
this->ctrld.StartupDelay(); |
| 37 |
|
|
| 38 |
this->ctrld.InitThreadPool(); |
this->ctrld.InitThreadPool(); |
| 39 |
|
|
| 40 |
while (this->m_bIsRunning) |
while (this->m_bIsRunning) |
| 41 |
{ |
{ |
| 42 |
if (this->ctrld.begin() ==0) |
if (this->ctrld.begin() == 0) |
| 43 |
{ |
{ |
| 44 |
syslog << logfile::log_head << "Begin CONTROLD ... OK" << endl; |
syslog << logfile::log_head << "Begin CONTROLD ... OK" << endl; |
| 45 |
|
|
| 48 |
break; |
break; |
| 49 |
} |
} |
| 50 |
syslog << logfile::log_head << "Begin CONTROLD ... Failed" << endl; |
syslog << logfile::log_head << "Begin CONTROLD ... Failed" << endl; |
| 51 |
Sleep(1000 * 60); |
|
| 52 |
|
if (startup_err_count++ > 5) |
| 53 |
|
break; |
| 54 |
|
|
| 55 |
|
Sleep(1000 * 60 * 5); |
| 56 |
} |
} |
| 57 |
|
|
| 58 |
while (this->m_bIsRunning && this->ctrld.IsRunning()) |
while (this->m_bIsRunning && this->ctrld.IsRunning()) |