[rancid] clogin doesn't send explicitly set new lines

Aliaksei Sheshka sheshkaoss at gmail.com
Wed May 15 19:38:13 UTC 2013


Hi!

I'm facing rather strange clogin issue.
Consider file :
----begin nyy-r14-confg.sample file ---
sh clock
copy system:/running-config tftp://10.18.15.11/nyy-r14-confg




sh clock
----end nyy-r14-confg.sample file ---
There are four lines with '\n' only.
My idea was that:
cisco says -> Address or name of remote host [10.18.15.11]?
clogin sends -> '\n'
cisco says -> Destination filename [nyy-r14-confg]?
clogin sends -> '\n'
And then two times '\n' just for test.
Nope, clogin just stuck. Debug message for "$clogin -d -t 3600 -x
nyy-r14-confg.sample nyy-r14" :

expect: does "Address or name of remote host [10.18.15.11]? "
(spawn_id exp6) match regular expression "\u0008+"? (No Gate, RE only)
gate=yes re=no
"^[^\n\r *]*nyy-r14([^#>\r\n]+)?[#>](\([^)\r\n]+\))?"? Gate "*nyy-r14*"? gate=no
"^[^\n\r]*nyy-r14([^#>\r\n]+)?[#>](\([^)\r\n]+\))?."? Gate "*nyy-r14*"? gate=no
"^--More--[\r\n]+"? Gate "--More--*"? gate=no
"[^\r\n]*[\n\r]+"? (No Gate, RE only) gate=yes re=no
"[^\r\n]*Press <SPACE> to cont[^\r\n]*"? Gate "*Press <SPACE> to cont*"? gate=no
"^ *--More--[^\n\r]*"? Gate "*--More--*"? gate=no
"^<-+ More -+>[^\n\r]*"? (No Gate, RE only) gate=yes re=no

And then nothing, timeout.
System is Debian wheezy
expect                           5.44.1.15-4
rancid                           2.3.8-3

I added some lines:
$diff /usr/lib/rancid/bin/clogin.orig /usr/lib/rancid/bin/clogin
707a708,715
>          -re "Destination filename" {
>                                                   send_user -- "$expect_out(buffer)"
>                                                   send "\n"
>                                                   exp_continue }
>            -re "Address or name of remote host" {
>                                                   send_user -- "$expect_out(buffer)"
>                                                   send "\n"
>                                                   exp_continue }

and that suddenly fixed the issue.

That puzzled me, because I had a FreeBSD system with expect 5.44 and
rancid 2.3.6 and the same nyy-r14-confg.sample was processed without
any issues.
What could be wrong ?


More information about the Rancid-discuss mailing list