| 1 |
sysadm |
1.1 |
/*******************************************************/
|
| 2 |
|
|
/* */
|
| 3 |
|
|
/* LeafOK Innd */
|
| 4 |
|
|
/* Copyright (C) LeafOK.com, 2003-2004 */
|
| 5 |
|
|
/* */
|
| 6 |
|
|
/* Programmed by Leaf */
|
| 7 |
|
|
/* E-mail:leaf@leafok.com QQ:6049044 */
|
| 8 |
|
|
/* */
|
| 9 |
|
|
/* http://bbs.leafok.com */
|
| 10 |
|
|
/* http://bbs.leafok.net */
|
| 11 |
|
|
/* http://bbs.fenglin.info */
|
| 12 |
|
|
/* */
|
| 13 |
|
|
/*******************************************************/
|
| 14 |
|
|
|
| 15 |
|
|
#include "StdAfx.h"
|
| 16 |
|
|
#include ".\service.h"
|
| 17 |
|
|
|
| 18 |
|
|
using namespace std;
|
| 19 |
|
|
|
| 20 |
|
|
service::service(void)
|
| 21 |
|
|
:CNTService("Innd Service")
|
| 22 |
|
|
{
|
| 23 |
|
|
}
|
| 24 |
|
|
|
| 25 |
|
|
service::~service(void)
|
| 26 |
|
|
{
|
| 27 |
|
|
}
|
| 28 |
|
|
|
| 29 |
|
|
void service::Run()
|
| 30 |
|
|
{
|
| 31 |
|
|
this->ctrld.StartupDelay();
|
| 32 |
|
|
|
| 33 |
|
|
if (this->ctrld.begin() == 0)
|
| 34 |
|
|
{
|
| 35 |
|
|
syslog << logfile::log_head << "Begin CONTROL ... OK" << endl;
|
| 36 |
|
|
}
|
| 37 |
|
|
else
|
| 38 |
|
|
{
|
| 39 |
|
|
syslog << logfile::log_head << "Begin CONTROL ... Failed" << endl;
|
| 40 |
|
|
}
|
| 41 |
|
|
|
| 42 |
|
|
this->ctrld.StartupChild();
|
| 43 |
|
|
|
| 44 |
|
|
while (this->m_bIsRunning && this->ctrld.IsRunning())
|
| 45 |
|
|
{
|
| 46 |
|
|
Sleep(100);
|
| 47 |
|
|
}
|
| 48 |
|
|
|
| 49 |
|
|
this->ctrld.ShutdownChild();
|
| 50 |
|
|
|
| 51 |
|
|
if (this->ctrld.end() == 0)
|
| 52 |
|
|
{
|
| 53 |
|
|
syslog << logfile::log_head << "End CONTROL ... OK" << endl;
|
| 54 |
|
|
}
|
| 55 |
|
|
else
|
| 56 |
|
|
{
|
| 57 |
|
|
syslog << logfile::log_head << "End CONTROL ... Failed" << endl;
|
| 58 |
|
|
}
|
| 59 |
|
|
}
|