[rancid] Custom devices and ttys

Mark Loveley mloveley at plus.net
Tue Oct 9 13:09:31 UTC 2007


I'm trying to customize a rancid plugin to work with an Ellacoya e30  
which has a very cisco like interface.
clogin works fine from the command line by bails out when run from cron.

 From cron it asks me to "press any key to continue", when I send a  
carriage return, or any other key it asks me the same thing again.

it seems that the e30 behaves differently when there is a tty  
attached, as when I add -nottycopy after the spawn in the login  
script I get the same behavior on the cli as when it is run from cron  
without the ttycopy option.
ie to get this behavior on the cli I changed
                 set retval [ catch {spawn telnet $router} reason ]
                 set retval [ catch {spawn -nottycopy telnet $router}  
reason ]

Anyone here got any experience with devices that behave like this?
Or does anyone know the expect syntax to make rancid behave as if  
there is a tty?

I'm reasonably sure it's a tty issue as I have manually set  
environment variables such as TERM,COLUMNS,LINES etc. A packet trace  
of the telnet session shows that when launched from cron the width  
and height is set to zero when it negotiates the window size.

http://expect.nist.gov/FAQ.html#q26 implies there is a way to do this  
but helpfully you have to buy their book.

22_spawns_telnet_--_screen_height.html seems to solve a very similar  
issue in a perl script.

Any ideas?


| Mark Loveley                                  Broadband Solutions for
| Network Engineer                                    home and business
| PlusNet PLC                                             @www.plus.net
| Registered Office: Internet House, 2 Tenter Street, Sheffield, S1 4BY
| Registered in England no: 3279013
+ ------------ PlusNet - The smarter way to broadband ----------------+

More information about the Rancid-discuss mailing list