[rancid] Rancid 3.1 control_rancid errors when there are diffs

Daniel Shields grungelizard9 at hotmail.com
Wed Mar 11 18:30:05 UTC 2015


Thanks Lee,
     You're exactly right.  I changed all of the 
 )| -t $MAILOPTSlines to  )| sendmail -t $MAILOPTS
and mail is being sent.  Just need to get my aliases straightened out so that they get sent to the right email address.  Thanks!

From: lee.e.rian at census.gov
To: grungelizard9 at hotmail.com; namelessjoe at hotmail.com; rancid-discuss at shrubbery.net
Subject: Re: [rancid] Rancid 3.1 control_rancid errors when there are diffs
Date: Wed, 11 Mar 2015 16:58:22 +0000








You don't have a program called "-t" so yes, it's going to complain about " -t: not found"



I have no idea how postfix works -- maybe piping the output of all those echo commands to

  postfix -t $MAILOPTS

will send you mail, in which case you need to change all the

  )| -t $MAILOPTS

lines to

  )| postfix -t $MAILOPTS





Regards,

Lee













From: Daniel Shields <grungelizard9 at hotmail.com>

Sent: Wednesday, March 11, 2015 11:29 AM

To: Lee Rian (CENSUS/TCO FED); Tanner Lyle; rancid-discuss at shrubbery.net

Subject: RE: [rancid] Rancid 3.1 control_rancid errors when there are diffs
 


I have a similar issue running 3.1.99, but using postfix.  I get the error "/home/rancid/bin/control_rancid: 631: /home/rancid/bin/control_rancid: -t: not found".  I had the same issue before upgrading (was running 3.1).  "        ) |  -t $MAILOPTS"
 is the line of the control_rancid where it hangs.  Any help is greatly appreciated.




 if [ $MAXSZ -eq 0 ] ; then
        (
          echo "To: $mailrcpt"
          echo "Subject: $subject"
          echo "$MAILHEADERS" | awk '{L = "";LN = $0;while (LN ~ /\\n/) { I = index(LN,"\\n");L = L substr(LN,0,I-1) "\n";LN = substr(LN,I+2,length(LN)-I-1);}print L LN;}'
          echo ""
          cat $TMP.diff
        ) |  -t $MAILOPTS






# Additional options for sendmail(8).
#MAILOPTS="-f bounces.go.here at example.com"; export MAILOPTS







Trying to get all of the configs.
All routers sucessfully completed.



cvs diff: Diffing .
cvs diff: Diffing configs
cvs commit: Examining .
cvs commit: Examining configs
/home/rancid/var/rancid/CVS/demo-vpn/configs/imp_620,v  <--  configs/imp_620
new revision: 1.30; previous revision: 1.29
/home/rancid/bin/control_rancid: 631: /home/rancid/bin/control_rancid: -t: not found







Thanks!


From: lee.e.rian at census.gov

To: namelessjoe at hotmail.com; rancid-discuss at shrubbery.net

Date: Wed, 11 Mar 2015 14:58:12 +0000

Subject: Re: [rancid] Rancid 3.1 control_rancid errors when there are diffs




I had the same problem after building rancid on a machine that didn't have sendmail installed.  Install sendmail and edit control_rancid to change all the

  no -t $MAILOPTS

to

  sendmail -t $MAILOPTS





Regards,

Lee











From: Rancid-discuss <rancid-discuss-bounces at shrubbery.net> on behalf of Tanner Lyle <namelessjoe at hotmail.com>

Sent: Wednesday, March 11, 2015 10:07 AM

To: rancid-discuss at shrubbery.net

Subject: [rancid] Rancid 3.1 control_rancid errors when there are diffs
 


I have installed rancid 3.1 and have it working on a Ubuntu install.  It works and collects diffs and shows them in the repository and i have the cvs web working, but i cannot get it to e-mail me the diffs and am getting an error
 in the var/logs only when there are diffs.  it errors on the control_rancid portion of it i can send mail through postfix with both the sendmail and mail command.  I installed postfix after sendmail fail as i thought it was my problem.  Below is the log of
 both and the control_rancid, and yes i am a newbie









rancid log when there are no changes




rancid at lyle ~/var/logs $ tail -f networking.20150311.080400 
starting: Wed Mar 11 08:04:00 CDT 2015



Trying to get all of the configs.
All routers sucessfully completed.



cvs diff: Diffing .
cvs diff: Diffing configs
cvs commit: Examining .
cvs commit: Examining configs



ending: Wed Mar 11 08:05:14 CDT 2015







rancid log when there are changes




rancid at lyle ~/var/logs $ tail -f networking.20150311.083546 
starting: Wed Mar 11 08:35:46 CDT 2015



Trying to get all of the configs.
All routers sucessfully completed.



cvs diff: Diffing .
cvs diff: Diffing configs
cvs commit: Examining .
cvs commit: Examining configs
/usr/local/rancid/var/CVS/networking/configs/foundryswitch,v  <--  configs/foundryswitch
new revision: 1.11; previous revision: 1.10
/usr/local/rancid/bin/control_rancid: 483: /usr/local/rancid/bin/control_rancid: no: not found



ending: Wed Mar 11 08:37:07 CDT 2015







control_rancid                  line 483 is the     ) | no -t $MAILOPTS




# Mail out the diffs (if there are any).
if [ -s $TMP.diff ] ; then
    MAXSZ=${MAILSPLIT:=0}
    if [ $MAXSZ -ne 0 ] ; then
BLOCKSIZE=1024; export BLOCKSIZE
tmpk=`perl -e "my(@S) = stat(\"$TMP.diff\"); print int(\\$S[7] / 1024);"`
unset BLOCKSIZE
if [ $tmpk -lt $MAXSZ ] ; then
   MAXSZ=0
fi
    fi
    if [ $MAXSZ -eq 0 ] ; then
(
 echo "To: $mailrcpt"
 echo "Subject: $subject"
 echo "$MAILHEADERS" | awk '{L = "";LN = $0;while (LN ~ /\\n/) { I = index(LN,"\\n");L = L substr(LN,0,I-1) "\n";LN = substr(LN,I+2,length(LN)-I-1);}print L LN;}'
 echo ""
 cat $TMP.diff
) | no -t $MAILOPTS
    else
CDIR=`pwd`
SDIR=${TMPDIR:=/tmp}/rancid.$GROUP.$$.mail
error=`mkdir $SDIR`
if [ $? -ne 0 ] ; then
   echo "Could not create $SDIR directory" >&2
   echo $error >&2
else
   cd $SDIR
   split -b${MAXSZ}k $TMP.diff
   nfiles=`ls | wc -l | sed -e 's/^ *//' |cut -d' ' -f1`
   n=0
   dt=`perl -e 'print time();'`
   for file in `ls`; do
n=`expr $n + 1`
MSGID="<$dt.RANCID$GROUP$$${nfiles}${n}@`hostname`>"
(
echo "To: $mailrcpt"
echo "Subject: $n of ${nfiles}: $subject"
echo "Message-Id: $MSGID"
if [ $n -gt 1 ] ; then
   echo "References: $LASTIDS"
fi
echo "$MAILHEADERS" | awk '{L = "";LN = $0;while (LN ~ /\\n/) { I = index(LN,"\\n");L = L substr(LN,0,I-1) "\n";LN = substr(LN,I+2,length(LN)-I-1);}print L LN;}'
echo ""
cat $file
) | no -t $MAILOPTS
LASTIDS="$LASTIDS $MSGID"
if [ $n -lt $nfiles ]; then
   # this just tries to make the msgs order right in MUAs
   sleep 1
fi
   done
   cd $CDIR
   rm -rf $SDIR
fi
    fi
fi




























_______________________________________________ Rancid-discuss mailing list Rancid-discuss at shrubbery.net http://www.shrubbery.net/mailman/listinfo/rancid-discuss




 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20150311/ec11130e/attachment.html>


More information about the Rancid-discuss mailing list