[rancid] Re: After upgrade rancid works, rancid-run does not work

Schmidt, Daniel dan.schmidt at uplinkdata.com
Fri Oct 30 19:29:43 UTC 2009


I believe this appears to be a control_rancid bug with inconsistent
capitalization.  Possible regression as it seemed to work before. 

You've got perl that lowercases everything here:

205 perl -F: -ane '{($F[0] =~ tr at A-Z@a-z@,print "$F[0]:$F[1]\n")
206     if ($F[2] =~ /^up$/i);}' routers.db > routers.up.new
207 if [ ! -f routers.up ] ; then touch routers.up; fi
208 diff -U 4 routers.up routers.up.new > /dev/null 2>&1; RUP=$?

So, if somebody uses an uppercase character, it will never match here:

356 # if a device (-r) was specified, see if that device is in this
group
357 if [ "X$device" != "X" ] ; then
358     trap 'rm -fr $TMP $DIR/routers.single;' 1 2 15
359     devlistfile="$DIR/routers.single"
360     grep "^$device:" routers.up > $devlistfile
361     if [ $? -eq 1 ] ; then
362         exit;
363     fi
364 else
365     devlistfile="$DIR/routers.up"
366 fi

It exits, conveniently without any error, at 362.  

I implemented a primitive fix to solve my problem.  

 51 tolower()
 52 {
 53         local char="$*"
 54 
 55                 out=$(echo $char | tr [:upper:] [:lower:])
 56                 local retval=$?
 57                 echo "$out"
 58                 unset out
 59                 unset char
 60                 return $retval
 61 }

 90             device=$(tolower "$1")


-----Original Message-----
From: rancid-discuss-bounces at shrubbery.net
[mailto:rancid-discuss-bounces at shrubbery.net] On Behalf Of Schmidt,
Daniel
Sent: Thursday, October 29, 2009 9:10 AM
To: john heasley
Cc: rancid-discuss at shrubbery.net
Subject: [rancid] Re: After upgrade rancid works, rancid-run does not
work

Thanks for your suggestion!  I am on Linux, however, the contents of
routers.up seem correct.  Is there other troubleshooting I can do?

-----Original Message-----
From: john heasley [mailto:heas at shrubbery.net] 
Sent: Wednesday, October 28, 2009 3:45 PM
To: Schmidt, Daniel
Cc: rancid-discuss at shrubbery.net
Subject: Re: [rancid] After upgrade rancid works, rancid-run does not
work

Wed, Oct 28, 2009 at 02:56:51PM -0600, Schmidt, Daniel:
> Many apologies if somebody has answered this - Rancid has always
worked
> for me before and I'm new to the list.  Any assistance greatly
> appreciated.  
> 
> clogin and rancid work fine after upgrade, given the correct PATH.
> clogin logs in correctly, rancid correctly creates a router.new file.
> rancid-run does not work.  The log is empty and tacacs logs show that
it
> didn't even try to login.
> 
> rancid at che-rancid-001:~/var/logs$ cat group_name.20091028.142620
> starting: Wed Oct 28 14:26:20 MDT 2009
> 
> 
> 
> ending: Wed Oct 28 14:26:21 MDT 2009
> rancid at che-rancid-001:~/var/logs$ 
> 
> Everything seemed to install to the correct location with the
following
> configure.  
> ./configure --localstatedir=/home/rancid --prefix=/home/rancid
> 
> I tried a new rancid.conf including the new CVSROOT commands, but have
> not have any luck.  Suggestions greatly appreciated! 

did routers.up get populated properly?  if not, i'm guess is youre on
linux and configure screwed-up figuring out the options to diff.
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss at shrubbery.net
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss


More information about the Rancid-discuss mailing list