<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:'Times New Roman', Times, serif;">
<p>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</p>
<p> no -t $MAILOPTS</p>
<p>to</p>
<p> sendmail -t $MAILOPTS</p>
<p><br>
</p>
<p>Regards,</p>
<p>Lee</p>
<p><br>
</p>
<p><br>
</p>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> Rancid-discuss <rancid-discuss-bounces@shrubbery.net> on behalf of Tanner Lyle <namelessjoe@hotmail.com><br>
<b>Sent:</b> Wednesday, March 11, 2015 10:07 AM<br>
<b>To:</b> rancid-discuss@shrubbery.net<br>
<b>Subject:</b> [rancid] Rancid 3.1 control_rancid errors when there are diffs</font>
<div> </div>
</div>
<div>
<div dir="ltr"><font size="4">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</font>
<div><br>
</div>
<div><br>
</div>
<div><font size="4"><br>
</font></div>
<div><font size="4"><b>rancid log when there are no changes</b></font></div>
<div><br>
</div>
<div>
<div>rancid@lyle ~/var/logs $ tail -f networking.20150311.080400 </div>
<div>starting: Wed Mar 11 08:04:00 CDT 2015</div>
<div><br>
</div>
<div><span style="font-size:12pt">Trying to get all of the configs.</span></div>
<div>All routers sucessfully completed.</div>
<div><br>
</div>
<div>cvs diff: Diffing .</div>
<div>cvs diff: Diffing configs</div>
<div>cvs commit: Examining .</div>
<div>cvs commit: Examining configs</div>
<div><br>
</div>
<div>ending: Wed Mar 11 08:05:14 CDT 2015</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><font size="4"><b>rancid log when there are changes</b></font></div>
<div><br>
</div>
<div>
<div>rancid@lyle ~/var/logs $ tail -f networking.20150311.083546 </div>
<div>starting: Wed Mar 11 08:35:46 CDT 2015</div>
<div><br>
</div>
<div><span style="font-size:12pt">Trying to get all of the configs.</span></div>
<div>All routers sucessfully completed.</div>
<div><br>
</div>
<div>cvs diff: Diffing .</div>
<div>cvs diff: Diffing configs</div>
<div>cvs commit: Examining .</div>
<div>cvs commit: Examining configs</div>
<div>/usr/local/rancid/var/CVS/networking/configs/foundryswitch,v <-- configs/foundryswitch</div>
<div>new revision: 1.11; previous revision: 1.10</div>
<div>/usr/local/rancid/bin/control_rancid: 483: /usr/local/rancid/bin/control_rancid: no: not found</div>
<div><br>
</div>
<div>ending: Wed Mar 11 08:37:07 CDT 2015</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><font size="4"><b>control_rancid line 483 is the ) | no -t $MAILOPTS</b></font></div>
<div><br>
</div>
<div>
<div># Mail out the diffs (if there are any).</div>
<div>if [ -s $TMP.diff ] ; then</div>
<div> MAXSZ=${MAILSPLIT:=0}</div>
<div> if [ $MAXSZ -ne 0 ] ; then</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>BLOCKSIZE=1024; export BLOCKSIZE</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>tmpk=`perl -e "my(@S) = stat(\"$TMP.diff\"); print int(\\$S[7] / 1024);"`</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>unset BLOCKSIZE</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>if [ $tmpk -lt $MAXSZ ] ; then</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> MAXSZ=0</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>fi</div>
<div> fi</div>
<div> if [ $MAXSZ -eq 0 ] ; then</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>(</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> echo "To: $mailrcpt"</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> echo "Subject: $subject"</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> 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;}'</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> echo ""</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> cat $TMP.diff</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span><b>) | no -t $MAILOPTS</b></div>
<div> else</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>CDIR=`pwd`</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>SDIR=${TMPDIR:=/tmp}/rancid.$GROUP.$$.mail</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>error=`mkdir $SDIR`</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>if [ $? -ne 0 ] ; then</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> echo "Could not create $SDIR directory" >&2</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> echo $error >&2</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>else</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> cd $SDIR</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> split -b${MAXSZ}k $TMP.diff</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> nfiles=`ls | wc -l | sed -e 's/^ *//' |cut -d' ' -f1`</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> n=0</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> dt=`perl -e 'print time();'`</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> for file in `ls`; do</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>n=`expr $n + 1`</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>MSGID="<$dt.RANCID$GROUP$$${nfiles}${n}@`hostname`>"</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>(</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>echo "To: $mailrcpt"</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>echo "Subject: $n of ${nfiles}: $subject"</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>echo "Message-Id: $MSGID"</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>if [ $n -gt 1 ] ; then</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> echo "References: $LASTIDS"</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>fi</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>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;}'</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>echo ""</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>cat $file</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>) | no -t $MAILOPTS</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>LASTIDS="$LASTIDS $MSGID"</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>if [ $n -lt $nfiles ]; then</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> # this just tries to make the msgs order right in MUAs</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> sleep 1</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>fi</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> done</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> cd $CDIR</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span> rm -rf $SDIR</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>fi</div>
<div> fi</div>
<div>fi</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>