本文整理汇总了C++中Owned::exec方法的典型用法代码示例。如果您正苦于以下问题:C++ Owned::exec方法的具体用法?C++ Owned::exec怎么用?C++ Owned::exec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Owned
的用法示例。
在下文中一共展示了Owned::exec方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main( int argc, char *argv[] )
{
int res=0;
if (argc < 3)
{
printf
("frunssh <nodelistfile> \"command\" [options] \n"
" options: -i:<identity-file> \n"
" -u:<user> \n"
" -n:<number_of_threads>\n"
" -t:<connect-timeout-secs>\n"
" -a:<connect-attempts>\n"
" -d:<working_directory>\n"
" -s -- strict, must match known_hosts\n"
" -b -- background\n"
" -pw:<password> -- INSECURE: requires pssh (NB identity file preferred)\n"
" -pe:<password> -- INSECURE: as -pw except encrypted password\n"
" -pl -- use plink (on windows)\n"
" -v -- verbose, lists commands run\n"
" -d -- dry run (for testing, enables verbose)\n"
);
return 255;
}
InitModuleObjects();
#ifndef __64BIT__
// Restrict stack sizes on 32-bit systems
Thread::setDefaultStackSize(0x10000); // NB under windows requires linker setting (/stack:)
#endif
try {
StringBuffer logname;
splitFilename(argv[0], NULL, NULL, &logname, NULL);
Owned<IComponentLogFileCreator> lf = createComponentLogFileCreator("frunssh");
lf->setCreateAliasFile(false);
lf->setMsgFields(MSGFIELD_prefix);
lf->beginLogging();
Owned<IFRunSSH> runssh = createFRunSSH();
runssh->init(argc,argv);
runssh->exec();
}
catch(IException *e)
{
EXCLOG(e,"frunssh");
e->Release();
res=255;
}
releaseAtoms();
return res;
}
示例2: main
int main( int argc, char *argv[] )
{
int res=0;
if (argc < 3)
{
printf
("frunssh <nodelistfile> \"command\" [options] \n"
" options: -i:<identity-file> \n"
" -u:<user> \n"
" -n:<number_of_threads>\n"
" -t:<connect-timeout-secs>\n"
" -a:<connect-attempts>\n"
" -d:<working_directory>\n"
" -s -- strict, must match known_hosts\n"
" -b -- background\n"
" -pw:<password> -- INSECURE: requires pssh (NB identity file preferred)\n"
" -pe:<password> -- INSECURE: as -pw except encrypted password\n"
" -pl -- use plink (on windows)\n"
" -v -- verbose, lists commands run\n"
" -d -- dry run (for testing, enables verbose)\n"
);
return 255;
}
InitModuleObjects();
try {
StringBuffer logname;
splitFilename(argv[0], NULL, NULL, &logname, NULL);
StringBuffer logdir;
if (getConfigurationDirectory(NULL,"log","frunssh",logname.str(),logdir)) {
recursiveCreateDirectory(logdir.str());
StringBuffer tmp(logname);
addPathSepChar(logname.clear().append(logdir)).append(tmp);
}
addFileTimestamp(logname, true);
logname.append(".log");
appendLogFile(logname.str(),0,false);
queryStderrLogMsgHandler()->setMessageFields(MSGFIELD_prefix);
Owned<IFRunSSH> runssh = createFRunSSH();
runssh->init(argc,argv);
runssh->exec();
}
catch(IException *e)
{
EXCLOG(e,"frunssh");
e->Release();
res=255;
}
releaseAtoms();
return res;
}