rancid hangs due to expect, ssh, or cisco?

john heasley heas at shrubbery.net
Mon Dec 23 22:39:28 UTC 2002


are you saying that after the last line of the debug output below, you do
not receive a shell prompt?  or, are you referring to the 'time-out
activated' that appears in the output?

if the latter, i suspect it is the cisco that is disconnecting and the fix
would be to increase your vty session and/or exec timeouts.  the cisco does
not reset it's timer on output, only input.  it is conceivable that it
could take long enough to generate and display the configuration to activate
the timer.

if the former, maybe the expect_before is not remaining active.  i would
have to research that, since it works here (sparc, netbsd, exp 5.33,
tcl 8.3.2).

Mon, Dec 23, 2002 at 02:58:26PM -0600, Zhang, Anchi:
> SunOS netadmin 5.8 Generic_108528-07 sun4u sparc SUNW,UltraSPARC-IIi-cEngine
> rancid-2.2.2, expect-5.38, tcl-8.4.1, tk-8.4.1
> openssh-3.4p1
> 
> Rancid over telnet runs well.
> 
> Rancid over ssh hangs, clogin -c "show run" <hostname> hangs, clogin <hostname> and then "show run" at the enable prompt also hangs.  Below is the tail portion of clogin -c "show run" ecdc2ibgp with expect -d.  Pointers will be appreciated.
> 
> expect: does "ntp server 158.81.250.130\r\nend\r\n\r\necdc2ibgp#Received disconnect from 158.81.248.251: Time-out activated\r\n" (spawn_id exp4) match regular expression "\u0008+"? no
> "^[^\n\r *]*ecdc2ibgp(\([^\r\n]+\))?#"? no
> "^[^\n\r]*ecdc2ibgp(\([^\r\n]+\))?#."? no
> "[\n\r]+"? yes
> expect: set expect_out(0,string) "\r\n"
> expect: set expect_out(spawn_id) "exp4"
> expect: set expect_out(buffer) "ntp server 158.81.250.130\r\n"
> ntp server 158.81.250.130
> expect: continuing expect
> 
> expect: does "end\r\n\r\necdc2ibgp#Received disconnect from 158.81.248.251: Time-out activated\r\n" (spawn_id exp4) match regular expression "\u0008+"? no
> "^[^\n\r *]*ecdc2ibgp(\([^\r\n]+\))?#"? no
> "^[^\n\r]*ecdc2ibgp(\([^\r\n]+\))?#."? no
> "[\n\r]+"? yes
> expect: set expect_out(0,string) "\r\n\r\n"
> expect: set expect_out(spawn_id) "exp4"
> expect: set expect_out(buffer) "end\r\n\r\n"
> end
> 
> expect: continuing expect
> 
> expect: does "ecdc2ibgp#Received disconnect from 158.81.248.251: Time-out activated\r\n" (spawn_id exp4) match regular expression "\u0008+"? no
> "^[^\n\r *]*ecdc2ibgp(\([^\r\n]+\))?#"? yes
> expect: set expect_out(0,string) "ecdc2ibgp#"
> expect: set expect_out(spawn_id) "exp4"
> expect: set expect_out(buffer) "ecdc2ibgp#"
> ecdc2ibgp#send: sending "exit\r" to { exp4 }
> 
> expect: does "Received disconnect from 158.81.248.251: Time-out activated\r\n" (spawn_id exp4) match glob pattern "Do you wish to save your configuration changes"? no
> "\n"? yes
> expect: set expect_out(0,string) "\n"
> expect: set expect_out(spawn_id) "exp4"
> expect: set expect_out(buffer) "Received disconnect from 158.81.248.251: Time-out activated\r\n"
> expect: continuing expect
> 
> expect: does "" (spawn_id exp4) match glob pattern "Do you wish to save your configuration changes"? no
> "\n"? no
> expect: read eof
> expect: set expect_out(spawn_id) "exp4"
> expect: set expect_out(buffer) ""



More information about the Rancid-discuss mailing list