I am seeing an issue when using Net-SSH-Expect to SSH a linux Fedora-18 system. Specifically, I am seeing issue when I send the command “reboot” over SSH to the linux host to reboot the system.

Below is the sequence of commands I send.

1.Create a new Net::SSH::Expect connection.

2.Send a sample command to the remote linux host to make sure the connection is OK.

3.Send ‘reboot’ command over SSH. The command “reboot” also goes through perfectly fine.

4.After sending any command, I typically do ‘waitfor’ in Expect.pm & this is where the issue is observed.

5.‘waitfor’ calls ‘_sec_expect’ function again in Expect.pm, which throws down the below error.

3:Child PID 3328 exited with status 65280

The $before variable shows this. Connection to 192.168.200.1 closed by remote host. Connection to 192.168.200.1 closed.

Could anyone please advice on why i am seeing this error ? Shouldn't we expect the connection to close down after reboot is issued ?

To me looks like Expect.pm is expecting that the connection should be already there even after the reboot command is send.

Note that the issue was not observed with Fedora-14.


In reply to Net-SSH-Expect & Fedora-18 by hardy004

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.