Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^2: Net::Telnet: remote job completion

by maskull (Novice)
on Feb 28, 2012 at 10:55 UTC ( #956627=note: print w/replies, xml ) Need Help??

in reply to Re: Net::Telnet: remote job completion
in thread Net::Telnet: remote job completion

Assuming I go with the waitfor() option, do I still have to pass $telnet->cmd("\cC") to force Ctrl-C on my tail command after each job? Have no way of testing it right now but I would assume so if I'm to get the prompt again.

Replies are listed 'Best First'.
Re^3: Net::Telnet: remote job completion
by Eliya (Vicar) on Feb 28, 2012 at 14:04 UTC

    Yes.  In order to try, I installed telnetd in a sandbox, and it seems to work fine (i.e. ->cmd("\cC") actually does get a SIGINT being delivered to the tail -f).

    ... $telnet->print("/path/to/script") or die $telnet->errmsg; $telnet->print("tail -f /tmp/testxxx") or die $telnet->errmsg; $telnet->waitfor('/FINISHED/'); $telnet->cmd("\cC") or die $telnet->errmsg; ... (run next script)

    where script goes in the background and writes a few lines to /tmp/testxxx, with the last line being "FINISHED".

      Thanks! I'll go with this solution. The only problem I found is my timeout in waitfor() as the jobs can run for quite a while. I'll have to adjust for that.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://956627]
[marto]: /me puts anti jingle chip in [Corion]'s brain
Veltro hmm
[Corion]: Oooh - LLVM support, that sounds nice. And also scary because that means an easier avenue to create and exploit machine-runnable code from (badly parsed, buffer-overwriting ) SQL ;)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2018-05-24 13:55 GMT
Find Nodes?
    Voting Booth?