#ifdef HAS_SETUSERNAME //设置以特殊用户身份运行
if (args.HasOption('u')) { //默认值是关闭的
const PString username = args.GetOptionString('u');
if ( !SetUserAndGroup(username) ) {
cout << "GNU Gatekeeper could not run as user "
<< username
<< endl;
return;
}
}
#endif
if(!InitLogging(args) || !InitToolkit(args)) //InitLogging对日志和跟踪(Trace)进行初始化
return; //InitToolkit
if (args.HasOption('h')) { //如果包含命令行参数'h'
PrintOpts(); //显示帮助信息
ExitGK(); //停止Log和Trace,删除Toolkit并退出
}
if (!InitConfig(args) || !InitHandlers(args))//InitConfig读取INI配置文件
ExitGK(); //InitHandlers设置Ctrl+C停止热键
EnableLogFileRotation(); //开始记录日志
PString welcome("OpenH323 Gatekeeper - The GNU Gatekeeper with ID '" + Toolkit::GKName() + "' started\n" + Toolkit::GKVersion());
cout << welcome << '\n';
PTRACE(1, welcome);
if (args.HasOption('i')) //使用自定义的IP地址
Toolkit::Instance()->SetGKHome(args.GetOptionString('i').Lines());
std::vector
本文地址:http://com.8s8s.com/it/it34623.htm