[rancid] Re: lrancid / llogin

Ron Whitney ron.whitney at doitbest.com
Thu May 6 13:11:08 UTC 2010


James, can you send me your working llogin script:  I added your patch
to mine and it is helping me get farther.  However, it didn't seem to
execute correctly.  (I'm guessing I have a typo.)  Here's what I'm
getting now:

[rancid at harpo bin]$ lrancid -d groucho
executing llogin -t 90 -c"BackupFiles" groucho
groucho: missed cmd(s): BackupFiles
groucho: missed cmd(s): BackupFiles


[rancid at harpo bin]$ llogin -t 10 -c"BackupFiles" groucho
groucho
spawn ssh -c 3des -x -l root groucho
root at groucho's password:
Last login: Thu May  6 09:03:40 2010 from 12-162-57-170.doitbest.com
groucho 09:04:02 SU > export HISTIGNORE="&:cat *:exit*:export *";export
LANG=C
groucho 09:04:03 SU >
groucho 09:04:03 SU > BackupFiles
-bash: BackupFiles: command not found
groucho 09:04:03 SU > exit
logout
Connection to groucho closed.
 
Snippet from my .cloginrc file:

add method      groucho         {ssh}
add user        groucho         {root}
add password    groucho         {deleted}       {deleted}
add noenable    groucho         1
add backupfile  groucho         /var/named/p/mydoitbest.com


Thoughts anyone?  Thanks.

Ron


> -----Original Message-----
> From: rancid-discuss-bounces at shrubbery.net 
> [mailto:rancid-discuss-bounces at shrubbery.net] On Behalf Of 
> Mr. James W. Laferriere
> Sent: Wednesday, May 05, 2010 23:32
> To: Diego Ercolani
> Cc: rancid-discuss at shrubbery.net
> Subject: [rancid] Re: lrancid / llogin
> 
> 
>  	Hello Diago ,
> 
>  	Right in line with the other users I had difficutlies 
> ssh'ng to one of 
> my systems ,  it's a Slackware Distro. & I noticed a few things .
> 
>  	The "$prompt" had (imo) extra chars in it that 
> prevented the script from 
> completing see attached & inline patch .  Maybe someone can 
> clean it up a tad 
> more to make it submittable .
> 
>  	Hope this helps others .  JimL
> 
> 
> # llogin -noenable dsb-esx01
> dsb-esx01
> spawn ssh -c des -x -l root dsb-esx01
> No valid ciphers for protocol version 2 given, using defaults.
> The authenticity of host 'dsb-esx01 (10.1.1.102)' can't be 
> established.
> RSA key fingerprint is 
> 3c:b8:0f:f5:51:7b:36:b8:0f:3e:de:66:75:a9:22:7b.
> Are you sure you want to continue connecting (yes/no)?
> Host dsb-esx01 added to the list of known hosts.
> yes
> Warning: Permanently added 'dsb-esx01' (RSA) to the list of 
> known hosts.
> root at dsb-esx01's pssword:
> Last login: Thu Apr  1 08:50:40 2010 from mo-it07.dsb.local
> [root at dsb-esx01 root]# dir
> 
> Error: TIMEOUT reached
> 
> 
> -- 
> +------------------------------------------------------------------+
> | James   W.   Laferriere | System    Techniques | Give me VMS     |
> | Network&System Engineer | 3237     Holden Road |  Give me Linux  |
> | babydr at baby-dragons.com | Fairbanks, AK. 99709 |   only  on  AXP |
> +------------------------------------------------------------------+
> 
> --- llogin-ORIG 2010-05-05 10:31:59.000000000 -0800
> +++ llogin      2010-05-05 11:45:14.000000000 -0800
> @@ -714,7 +714,7 @@
>          # if it is not a "MetaCommand", passes the command "as is" to
>          # the console
>          # send_user "[subst [lindex $commands $i]]\n"
> -       switch -glob -nocase [subst -nocommands [lindex 
> $commands $i]] {
> +       switch -glob [subst -nocommands [lindex $commands $i]] {
>           backupfiles {
>             set files [find backupfile $host]
>              if { [info exists files] && [llength $files] > 0 } {
> @@ -752,9 +752,12 @@
>       log_user 1
> 
>       send -- "exit\r"
> +###                                              return 0
>       expect {
>          -re "\b+"       { exp_continue }
> -       -re "Connection to .* closed" { return 0}
> +       -re "Connection to .* closed"           {
> +                                                 exp_continue;
> +                                               }
>          -re "^\[^\n\r *]*$reprompt"             {
>                                                    # the 
> Cisco CE and Jnx
> ERX
>                                                    # return to
> non-enabled mode
> @@ -798,17 +801,17 @@
>       if $avautoenable {
>          set autoenable 1
>          set enable 0
> -       set prompt ":~# "
> +       set prompt "# "
>       } else {
>          set ae [find autoenable $router]
>          if { "$ae" == "1" } {
>              set autoenable 1
>              set enable 0
> -           set prompt ":~# "
> +           set prompt "# "
>          } else {
>              set autoenable 0
>              set enable $avenable
> -           set prompt ":~> "
> +           set prompt "> "
>          }
>       }
> 


More information about the Rancid-discuss mailing list