On Fri, 02 Jun 2006 16:33:46 -0700, Xumin.Lucky wrote:
> Then, the child process keep listening. The father process use
> system("ssh....") to remote start that node.
First, you should look for a library in your chosen language (C?) which
would do what you need. I recently came across one for Perl (no, it
doesn't fork() off processes), as it happens. There may very well be one
for your language too.
What about
:
http://netsieben.com/products/sshlib/specs.phtml
Or:
http://freshmeat.net/projects/libssh/
Alternatively, if I were doing what you appear to be doing I'd have the
child process providing the SSH behavior. Since you can have the
information flowing whichever way you want, I don't suppose this is too
important. But I think it would mean less change for your code. The
child process, and a couple of pipe()s, provides you with descriptors into
and out from the SSH process that your parent process can use similarly
the descriptors from the rexec() call.
It should be workable.
You wrote:
> The error shows that these two machine do not
> communicate in a nice way.
but don't explain what you mean by that.
- Andrew