[rancid] Re: Rancid Reports Changes in router.db when no changes have been made

Schmidt, Daniel dan.schmidt at uplinkdata.com
Thu Nov 5 22:16:42 UTC 2009


What is odd is that this only seems to do this when you rancid-run from
the command line when the previous run was from Cron.  (or visa versa)
Relevant code doesn't seem like much:

182 cut -d: -f1,2 routers.db > routers.all.new

189 perl -F: -ane '{($F[0] =~ tr at A-Z@a-z@,print "$F[0]:$F[1]\n")
190     if ($F[2] =~ /^up$/i);}' routers.db > routers.up.new

192 diff -u -4 routers.up routers.up.new > /dev/null 2>&1; RUP=$?

194 if [ $RALL -ne 0 -o $RDOWN -ne 0 -o $RUP -ne 0 ]
195 then
196     (
197         if [ $RUP -ne 0 ] ; then
198             if [ ! -s routers.up ] ; then
199                 echo Routers changed to up:
200                 sed -e 's/^/        /' routers.up.new
201                 echo
202             else
203                 WCUP=`comm -13 routers.up routers.up.new | wc -l | \
204                         sed -e 's/^ *\([^ ]*\)/\1/'`
205                 if [ $WCUP -gt 0 ] ; then
206                     echo Routers changed to up:

Term is set to network in rancid.conf, so I'm stumped as to how RUP or
WCUP is nonzero on this.


More information about the Rancid-discuss mailing list