working on distribution infrastructure some more, ssh working

git-svn-id: svn://anubis/fart/trunk@222 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop committed 2009-04-05 16:42:30 +00:00
1 parent 74399fe145
commit 1dbe7040e4
5 files changed
+73 -8

No files matched your search

+13 -2
View File
@@ -53,10 +53,14 @@ int distrib::connect(const string & host)
}
else /* in the child */
{
char server_port_str[15];
sprintf(server_port_str, "%d", m_serverport);
execlp("ssh", "ssh", host.c_str(),
"fart", "--host", m_servername.c_str(),
"--port", m_serverport,
NULL);
"--port", server_port_str,
(char *) NULL);
/* we should not get here */
cerr << "Error " << errno << " with execlp()!" << endl;
exit(33);
}
@@ -66,6 +70,8 @@ int distrib::connect(const string & host)
int distrib::startServer()
{
connect();
char hostname[1000];
gethostname(&hostname[0], 1000);
m_servername = hostname;
@@ -105,3 +111,8 @@ int distrib::startServer()
return 0;
}
int distrib::startClient(const char * server, int port)
{
return 0;
}
+3 -1
View File
@@ -9,11 +9,13 @@ class distrib
{
public:
int readHostFile(const char * filename);
int connect();
int startServer();
int startClient(const char * server, int port);
protected:
int connect();
int connect(const std::string & host);
std::vector<std::string> m_hosts;
std::vector<int> m_children;
std::string m_servername;