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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi there,

The problem is that Ssh doesn't have a lot of options when it comes to responding to a timeout. Checkout the Timeouts section of the documentation to see there are really two options.

The first and default option is to close down the socket the remote system is using for input. In the ideal case the remote is configured to recognize this situation and terminate all running processes associated with the login. Clearly that's not happening on your remote, at least not while it's executing "sleep 10".

The other option which you can enable, will terminate all connections to the remote and immediately continue the execution of your local script. The downside with this is that the remote script may continue executing, and you wont capture any of its output. To enable this option change your params to:

my %param=( user => $user, password=>'xxxxxx', port => '22', kill_ssh_on_timeout => 1);
You should see this error printed by your script:
operation didn't complete successfully: ssh slave failed: timed out at + ...

In reply to Re: why timeout not working in Net::OpenSSH by Loops
in thread why timeout not working in Net::OpenSSH by aqwsh2006

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-25 11:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found