| 1 |
/*******************************************************/ |
/*******************************************************/ |
| 2 |
/* */ |
/* */ |
| 3 |
/* LeafOK Innd */ |
/* LeafOK Innbbsd */ |
| 4 |
/* Copyright (C) LeafOK.com, 2003-2004 */ |
/* Copyright (C) LeafOK.com, 2003-2004 */ |
| 5 |
/* */ |
/* */ |
| 6 |
/* Programmed by Leaf */ |
/* Programmed by Leaf */ |
| 7 |
/* E-mail:leaf@leafok.com QQ:6049044 */ |
/* E-mail:leaflet@leafok.com QQ:6049044 */ |
| 8 |
/* */ |
/* */ |
| 9 |
/* http://bbs.leafok.com */ |
/* http://bbs.leafok.com */ |
| 10 |
/* http://bbs.leafok.net */ |
/* http://bbs.leafok.net */ |
| 20 |
#include ".\innbbsd.h" |
#include ".\innbbsd.h" |
| 21 |
#include ".\service.h" |
#include ".\service.h" |
| 22 |
#include ".\bbs_fun.h" |
#include ".\bbs_fun.h" |
| 23 |
|
#include ".\App_common.h" |
| 24 |
|
|
| 25 |
#ifdef _DEBUG |
#ifdef _DEBUG |
| 26 |
#define new DEBUG_NEW |
#define new DEBUG_NEW |
| 79 |
if (argc == 2 && _stricmp(argv[1], "-s") == 0) |
if (argc == 2 && _stricmp(argv[1], "-s") == 0) |
| 80 |
{ |
{ |
| 81 |
innbbsd_srv.ctrld.InitThreadPool(); |
innbbsd_srv.ctrld.InitThreadPool(); |
|
innbbsd_srv.ctrld.begin(); |
|
|
innbbsd_srv.ctrld.StartupChild(); |
|
| 82 |
|
|
| 83 |
while (innbbsd_srv.ctrld.IsRunning()) |
if (innbbsd_srv.ctrld.begin() == 0) |
| 84 |
{ |
{ |
| 85 |
Sleep(100); |
syslog << logfile::log_head << "Begin CONTROLD ... OK" << endl; |
| 86 |
} |
|
| 87 |
|
innbbsd_srv.ctrld.StartupChild(); |
| 88 |
|
|
| 89 |
|
while (innbbsd_srv.ctrld.IsRunning()) |
| 90 |
|
{ |
| 91 |
|
Sleep(100); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
innbbsd_srv.ctrld.ShutdownChild(); |
| 95 |
|
} |
| 96 |
|
else |
| 97 |
|
{ |
| 98 |
|
syslog << logfile::log_head << "Begin CONTROLD ... Failed" << endl; |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
if (innbbsd_srv.ctrld.end() == 0) |
| 102 |
|
{ |
| 103 |
|
syslog << logfile::log_head << "End CONTROLD ... OK" << endl; |
| 104 |
|
} |
| 105 |
|
else |
| 106 |
|
{ |
| 107 |
|
syslog << logfile::log_head << "End CONTROLD ... Failed" << endl; |
| 108 |
|
} |
| 109 |
|
|
|
innbbsd_srv.ctrld.ShutdownChild(); |
|
|
innbbsd_srv.ctrld.end(); |
|
| 110 |
innbbsd_srv.ctrld.CleanupThreadPool(); |
innbbsd_srv.ctrld.CleanupThreadPool(); |
| 111 |
|
|
| 112 |
|
ExitProcess(0); |
| 113 |
|
|
| 114 |
return 0; |
return 0; |
| 115 |
} |
} |
| 116 |
|
|
| 117 |
// Parse for standard arguments (install, uninstall, version etc.) |
// Display version infomation |
| 118 |
|
if (argc == 2 && _stricmp(argv[1], "-c") == 0) |
| 119 |
|
{ |
| 120 |
|
cout << App_common::GetVersion() << endl; |
| 121 |
|
cout << App_common::Copyright << endl; |
| 122 |
|
} |
| 123 |
|
|
| 124 |
|
// Parse for standard arguments (install, uninstall, version etc.) |
| 125 |
if (!innbbsd_srv.ParseStandardArgs(argc, argv)) { |
if (!innbbsd_srv.ParseStandardArgs(argc, argv)) { |
| 126 |
//DebugBreak(); |
//DebugBreak(); |
| 127 |
innbbsd_srv.StartService(); |
innbbsd_srv.StartService(); |