Mailing List Archive

rancid hangs due to expect, ssh, or cisco?
On Tue, Dec 31, 2002 23:08 Andrew Partan wrote:
>On Tue, Dec 31, 2002 at 02:49:48PM -0600, Zhang, Anchi wrote:
>> My temporary workaround to this problem is
>>
>> log2# diff clogin clogin.orig
>> 457c457
>> < send "term length 100\r"
>> ---
>> > send "term length 0\r"
>
>Well that is whacko. Is 'term length 0' not working on your router?
> --asp

I have the same problem here. Commands doing a lot of output hangs.
If I do clogin -c "wr ter" <somerouter> on a device with a large config
clogin hangs. Likewise with "sh cam dyn" on some catalysts as well.

I've basically used the same workaround, but also had to add a prompt
because one of my Cats changed the more prompt.

--SNIP--
--- clogin.in Tue Jul 30 07:14:10 2002
+++ /home/rancid/bin/clogin Fri Feb 7 13:00:40 2003
@@ -452,9 +454,9 @@
# skip if its an extreme.
if { [ string compare "extreme" "$platform" ] } {
if [ regexp -- ".*> .*enable" "$prompt" ] {
- send "set length 0\r"
+ send "set length 100\r"
} else {
- send "term length 0\r"
+ send "term length 100\r"
}
regsub -all "\[)(]" $prompt {\\&} reprompt
# match cisco config mode prompts too, but not for catalyst ie:
(enable)
@@ -496,6 +498,9 @@
-re "^ --More--\[^\n\r]*" {
send " "
exp_continue }
+ -re "^--More--\[^\n\r]*" {
+ send " "
+ exp_continue }
-re "^<-+ More -+>\[^\n\r]*" {
send_user --
"$expect_out(buffer)"
send " "
@@ -526,6 +531,9 @@
-re "^ --More--\[^\n\r]*" {
send " "
exp_continue }
+ -re "^--More--\[^\n\r]*" {
+ send " "
+ exp_continue }
-re "^<-+ More -+>\[^\n\r]*" {
send_user --
"$expect_out(buffer)"
send " "
--SNIP--
Could probably be solved in a nicer way by adjusting the regexp above it,
but I had
to fix it somewhat in a rush, and since forgotten about it.

Regards,
Johan
rancid hangs due to expect, ssh, or cisco? [ In reply to ]
Fri, Feb 07, 2003 at 01:13:20PM -0000, Johan Grip:
> On Tue, Dec 31, 2002 23:08 Andrew Partan wrote:
> >On Tue, Dec 31, 2002 at 02:49:48PM -0600, Zhang, Anchi wrote:
> >> My temporary workaround to this problem is
> >>
> >> log2# diff clogin clogin.orig
> >> 457c457
> >> < send "term length 100\r"
> >> ---
> >> > send "term length 0\r"
> >
> >Well that is whacko. Is 'term length 0' not working on your router?
> > --asp
>
> I have the same problem here. Commands doing a lot of output hangs.
> If I do clogin -c "wr ter" <somerouter> on a device with a large config
> clogin hangs. Likewise with "sh cam dyn" on some catalysts as well.
>
> I've basically used the same workaround, but also had to add a prompt
> because one of my Cats changed the more prompt.

can you tell me what operating system you are using and what version of
expect/tcl?
rancid hangs due to expect, ssh, or cisco? [ In reply to ]
> On Fri, Feb 07, 2003 19:15 john heasley wrote:
> Fri, Feb 07, 2003 at 01:13:20PM -0000, Johan Grip:
> > On Tue, Dec 31, 2002 23:08 Andrew Partan wrote:
> > >On Tue, Dec 31, 2002 at 02:49:48PM -0600, Zhang, Anchi wrote:
> > >> My temporary workaround to this problem is
> > >>
> > >> log2# diff clogin clogin.orig
> > >> 457c457
> > >> < send "term length 100\r"
> > >> ---
> > >> > send "term length 0\r"
> > >
> > >Well that is whacko. Is 'term length 0' not working on
> your router?
> > > --asp
> >
> > I have the same problem here. Commands doing a lot of output hangs.
> > If I do clogin -c "wr ter" <somerouter> on a device with a
> large config
> > clogin hangs. Likewise with "sh cam dyn" on some catalysts as well.
> >
> > I've basically used the same workaround, but also had to
> add a prompt
> > because one of my Cats changed the more prompt.
>
> can you tell me what operating system you are using and what
> version of
> expect/tcl?
>

I'm running this on Debian GNU/Linux 3.0r1 using only the debian
packages. The version are:
expect version 5.32.2
Tcl 8.3.3

I have tried the patch present on the rancid homepage, but it did not
help much. It does seem like a different problem, as it work 100% as long
as the output from any single command does not become to long. When a very
verbose command is run it always hangs. I have been trying to establish
it always occurs at the same bytecount of output but have not had that much
time to pour into it just yet.

Regards,
Johan