Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Controlling a terminal

by LAI (Hermit)
on Jan 21, 2003 at 18:31 UTC ( [id://228777]=note: print w/replies, xml ) Need Help??


in reply to Re: Controlling a terminal
in thread Controlling a terminal

So you want to run the same command simultaneously on several cluster nodes. Again, I think it would be too much of a headache to open n terminals and tell them all to pass stuff to shells. You would probably be better off using something like Net::SSH and just maintaining one session per node. Maintain an array of references to connections or something like that, and everytime you type a command into your GUI you iterate across the array and pass the command to each connection.


LAI
:eof

Replies are listed 'Best First'.
Re: Controlling a terminal
by naggiman (Novice) on Jan 22, 2003 at 12:41 UTC
    After a lot of hunting around on the net I have found out how to do what i want to do; just have to work out whether i not i should be doing it this way in general...
    use warnings; use strict; use constant TIOCSTI => 29719; my $fd; my $c="\n"; open($fd, ">>", "/dev/pts/30") || die "Could not open: $!"; my $val=ioctl($fd, TIOCSTI, $c); print "not ok\n" unless ($val);
    which will send a RETURN into the pseudo terminal (when run as root, anyhow).

    Thanks for your help.

      I'd personally not feel comfortable writing directly to devices like that, but if it does what you need it to then great. I'm enough of a stubborn ass that I still say you ought to let Perl handle the remote connections, but TMTOWTDI.


      LAI
      :eof
Re: Re^2: Controlling a terminal
by yodabjorn (Monk) on Jan 22, 2003 at 02:28 UTC
    Or even use something like SOAP or XML/RPC to do the server side work. I do this currently over SSL & apache or with the Frontier::RPC2 to collect some system/app stats with great results. I used to do similar things with ssh + keychain, but sometimes i would get some weird hangs on it.

    An intellectual is someone whose mind watches itself.
    - Albert Camus

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://228777]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-26 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found