<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><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></body>
</html>