[rancid] clogin hangs (ssh + cisco + bad password)

Gregory Bell grbell at lbl.gov
Thu Oct 4 22:43:47 UTC 2007


Hello,

In my environment, clogin hangs (taking >70% cpu) in the following 
situation:

- monitored device is running IOS
- method = ssh
- bad login password in .cloginrc

Obviously I should try to configure .cloginrc correctly ;-) but typos do 
occur and the hung process seems undesirable.

In the situation I described, it appears that this 'close' doesn't 
succeed in killing the ssh process:

    -re "(denied|Sorry)"    {
                   send_user "\nError: Check your passwd for $router\n"
                   catch {close}; wait; return 1
                 }

If I capture the ssh pid and try to kill it this way,

    -re "(denied|Sorry)"    {
                   send_user "\nError: Check your passwd for $router\n"
                   catch {exec kill $foo; close}; wait; return 1
                 }

- ssh dies as expected, but clogin hangs with high CPU nevertheless. 
This is just blundering around, though; I know nothing about expect.

I'm running FreeBSD 6.2, rancid 2.3.1, expect 5.43.0, OpenSSH_4.7p1.

I've tried using the version of clogin in rancid-2.3.2a7, with the same 
results.

Here's what I see when I run clogin manually:

rancid at mon ~ clogin c29s-50a-5191a-us24.lbnl.us
c29s-50a-5191a-us24.lbnl.us
spawn /usr/local/bin/ssh-441 -c 3des -x -l lblnet 
c29s-50a-5191a-us24.lbnl.us
CC

NOTICE TO USERS

<SNIP>

Error: Check your passwd for c29s-50a-5191a-us24.lbnl.us

###### here clogin hangs, with the expect process consuming > 70% CPU.

Any help would be appreciated.

- Greg





More information about the Rancid-discuss mailing list