Signaling another machine

P

Palaniappan

Hi all,

Is there any way to signal another machine?

My problem is...
I like to do run a sequence of perl scripts automatically in
different machines. They should be run one by one in different
machines in a sequence.

After completing a script in one machine, how to signal another
machine to start next script.

All machines are connected through LAN.

I know this group discusses mostly about perl coding. but i don't
have good knowledge about computer networks. so i am looking for
a perl solution directly, that's why i posted here.. :)

-with regards
palam
 
A

Anno Siegel

Palaniappan said:
Hi all,

Is there any way to signal another machine?

My problem is...
I like to do run a sequence of perl scripts automatically in
different machines. They should be run one by one in different
machines in a sequence.

After completing a script in one machine, how to signal another
machine to start next script.

All machines are connected through LAN.

I know this group discusses mostly about perl coding. but i don't
have good knowledge about computer networks. so i am looking for
a perl solution directly, that's why i posted here.. :)

That reminds me of the guy searching his car keys under a street light.
When asked if he had lost them there, he replies, "No, over there, but
there it's too dark to see".

Perl or no, you will still have to understand your network enough to be
able to start a process on one machine from another one. That procedure
depends entirely on your local network, Perl doesn't enter the equation.

Anno
 
U

Uri Guttman

P" == Palaniappan said:
Is there any way to signal another machine?

signals are machine local. perhaps you meant to say something else?
I like to do run a sequence of perl scripts automatically in
different machines. They should be run one by one in different
machines in a sequence.
After completing a script in one machine, how to signal another
machine to start next script.

again, don't use the term signal there. trigger might be a better term.

take a look at stem (on cpan or at stemsystems.com). it can be easily
configured to have processes running on multiple machines. you can have
a main object send messages to other machines to trigger starting a
process. when the process is done, a message can be sent back and that
main object can trigger the next one. doing this on your own will be a
very complex project. even with stem (which will reduce your coding by
half or more) it will require some work on your part as you have to
write this main object and learn how to configure the process cell (stem
object) to run your process and send back a message. if you need any
help, feel free to contact me.

uri
 
R

Rocco Caputo

I like to do run a sequence of perl scripts automatically in
different machines. They should be run one by one in different
machines in a sequence.

After completing a script in one machine, how to signal another
machine to start next script.

All machines are connected through LAN.

Set up ssh so you can log into the other machines from a "master"
machine. If you decide it's safe, you can omit the ssh passphrase, and
the master machine can log into them without a password prompt.

For each script you want to run...
... determine the machine to run it on.
... use Expect.pm or something like it to SSH into the machine.
... execute the command out there.
... collect any output you're interested in.
... log out.

Repeat until you run out of scripts and/or machines. It's not very
hard.
 
M

Mahesha

Palaniappan said:
Hi all,

Is there any way to signal another machine?

My problem is...
I like to do run a sequence of perl scripts automatically in
different machines. They should be run one by one in different
machines in a sequence.

After completing a script in one machine, how to signal another
machine to start next script.

All machines are connected through LAN.

I am not into networking, but this seemed to be a possible solution.

If the sequence in which a particular script is to be run on a specific
host is known, can you let one machine do the scheduling? Something on
the lines of...
------------
#!/usr/local/bin/perl -w

use strict;

my @work = (["host1" , "host1script"],
["host2" , "host2script"],
["host3" , "host3script"],
["host4" , "host4script"]
);

my $user="username";

foreach (@work) {
print `rsh -l $user @$_`;
}
 
J

Jim

Is there any way to signal another machine?

i think what you want is:
$ perldoc perlfaq9
$ perldoc perlipc

also, try browsing:
$ perldoc perltoc (table of contents)

this is documentation that comes with perl.

do these help?
 
J

James Willmore

Palaniappan wrote:
I am not into networking, but this seemed to be a possible solution.

If the sequence in which a particular script is to be run on a
specific host is known, can you let one machine do the scheduling?
Something on the lines of...
------------
#!/usr/local/bin/perl -w

use strict;

my @work = (["host1" , "host1script"],
["host2" , "host2script"],
["host3" , "host3script"],
["host4" , "host4script"]
);

my $user="username";

foreach (@work) {
print `rsh -l $user @$_`;
}
----------------

Nice, but not portable. What if these are Windoze boxes?

If you goes this route, you might as well use expect or the Expect
module for Perl.

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
WARNING TO ALL PERSONNEL: Firings will continue until morale
improves.
 
J

James Willmore

On 18 Dec 2003 07:55:07 -0800
Is there any way to signal another machine?

My problem is...
I like to do run a sequence of perl scripts automatically in
different machines. They should be run one by one in different
machines in a sequence.

After completing a script in one machine, how to signal another
machine to start next script.

All machines are connected through LAN.

I know this group discusses mostly about perl coding. but i don't
have good knowledge about computer networks. so i am looking for
a perl solution directly, that's why i posted here.. :)

You could set up a client script to run on each client and a server
script to run on a server box. The server script contacts the clients
ands then does whatever needs to be done.

Net::EasyTCP is a module that could aid in this task.

HTH

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
A continuing flow of paper is sufficient to continue the flow of
paper. -- Dyer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top