<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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:Calibri,Arial,Helvetica,sans-serif;">
<p>I have Rancid 3.1 working with Postfix:<br>
</p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">1. This removes the need to setup an alias in /etc/aliases for every single group</span><br>
</p>
<p> Postfix - /etc/postfix/main.cf<br>
</p>
<p> luser_relay = my.email@example.com<br>
</p>
<p> mydomain = [valid DNS domain]<br>
</p>
<p> myorigin = $mydomain<br>
</p>
<p> relayhost = [valid internal mail relay if you have one] <br>
</p>
<p>2. Rancid config:<br>
</p>
<p> etc/rancid.conf<br>
</p>
<p> SENDMAIL="/bin/true"<br>
</p>
<p> #MAILOPTS="-f ..."; export MAILOPTS <- all variables starting with MAIL are commented out<br>
</p>
<p>I get the diff reports and the config fetcher reports with the above configuration.<br>
</p>
<p>Dave<br>
</p>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Rancid-discuss <rancid-discuss-bounces@shrubbery.net> on behalf of Daniel Shields <grungelizard9@hotmail.com><br>
<b>Sent:</b> Wednesday, March 11, 2015 10:29 AM<br>
<b>To:</b> Lee Rian CENSUSTCO FED; Tanner Lyle; rancid-discuss@shrubbery.net<br>
<b>Subject:</b> Re: [rancid] Rancid 3.1 control_rancid errors when there are diffs</font>
<div> </div>
</div>
<div>
<div dir="ltr">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.
<div><br>
</div>
<div>
<div> if [ $MAXSZ -eq 0 ] ; then</div>
<div> (</div>
<div> echo "To: $mailrcpt"</div>
<div> echo "Subject: $subject"</div>
<div> 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> echo ""</div>
<div> cat $TMP.diff</div>
<div> <span style="background-color:rgb(255,255,0)"> ) | -t $MAILOPTS</span></div>
<div><br>
</div>
<div><br>
</div>
<div># Additional options for sendmail(8).</div>
<div>#MAILOPTS="-f bounces.go.here@example.com"; export MAILOPTS</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>Trying to get all of the configs.</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>/home/rancid/var/rancid/CVS/demo-vpn/configs/imp_620,v <-- configs/imp_620</div>
<div>new revision: 1.30; previous revision: 1.29</div>
<div>/home/rancid/bin/control_rancid: 631: /home/rancid/bin/control_rancid: -t: not found</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Thanks!</div>
<div>
<hr id="stopSpelling">
From: lee.e.rian@census.gov<br>
To: namelessjoe@hotmail.com; rancid-discuss@shrubbery.net<br>
Date: Wed, 11 Mar 2015 14:58:12 +0000<br>
Subject: Re: [rancid] Rancid 3.1 control_rancid errors when there are diffs<br>
<br>
<div id="ecxdivtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:'Times New Roman',Times,serif">
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<br>
no -t $MAILOPTS<br>
to<br>
sendmail -t $MAILOPTS<br>
<br>
<br>
Regards,<br>
Lee<br>
<br>
<br>
<br>
<br>
<div style="color:rgb(33,33,33)">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="ecxdivRplyFwdMsg" dir="ltr"><font color="#000000" face="Calibri, sans-serif" style="font-size:11pt"><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="ecxApple-tab-span" style="white-space:pre"></span>BLOCKSIZE=1024; export BLOCKSIZE</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>tmpk=`perl -e "my(@S) = stat(\"$TMP.diff\"); print int(\\$S[7] / 1024);"`</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>unset BLOCKSIZE</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>if [ $tmpk -lt $MAXSZ ] ; then</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> MAXSZ=0</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>fi</div>
<div> fi</div>
<div> if [ $MAXSZ -eq 0 ] ; then</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>(</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> echo "To: $mailrcpt"</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> echo "Subject: $subject"</div>
<div><span class="ecxApple-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="ecxApple-tab-span" style="white-space:pre"></span> echo ""</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> cat $TMP.diff</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span><b>) | no -t $MAILOPTS</b></div>
<div> else</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>CDIR=`pwd`</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>SDIR=${TMPDIR:=/tmp}/rancid.$GROUP.$$.mail</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>error=`mkdir $SDIR`</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>if [ $? -ne 0 ] ; then</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> echo "Could not create $SDIR directory" >&2</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> echo $error >&2</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>else</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> cd $SDIR</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> split -b${MAXSZ}k $TMP.diff</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> nfiles=`ls | wc -l | sed -e 's/^ *//' |cut -d' ' -f1`</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> n=0</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> dt=`perl -e 'print time();'`</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> for file in `ls`; do</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>n=`expr $n + 1`</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>MSGID="<$dt.RANCID$GROUP$$${nfiles}${n}@`hostname`>"</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>(</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>echo "To: $mailrcpt"</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>echo "Subject: $n of ${nfiles}: $subject"</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>echo "Message-Id: $MSGID"</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>if [ $n -gt 1 ] ; then</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> echo "References: $LASTIDS"</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>fi</div>
<div><span class="ecxApple-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="ecxApple-tab-span" style="white-space:pre"></span>echo ""</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>cat $file</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>) | no -t $MAILOPTS</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>LASTIDS="$LASTIDS $MSGID"</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>if [ $n -lt $nfiles ]; then</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> # this just tries to make the msgs order right in MUAs</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> sleep 1</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span>fi</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> done</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> cd $CDIR</div>
<div><span class="ecxApple-tab-span" style="white-space:pre"></span> rm -rf $SDIR</div>
<div><span class="ecxApple-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>
<br>
_______________________________________________ Rancid-discuss mailing list Rancid-discuss@shrubbery.net http://www.shrubbery.net/mailman/listinfo/rancid-discuss</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>