I haven't offered any such suggestions in the past on this list b/c I figured others would know better, so take this for what it's worth: <br><br>you might try calling a wrapper script from SEC (instead of directly calling rancid-run -r hostname) that can wait for the prior run of RANCID to complete. If you add some controls to ensure you don't fire off too many waiting wrapper scripts, it might be even safer:<br>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#!/usr/bin/perl</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">my ($host) = shift;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">my $lockFile = '/tmp/</span><b style="font-family: courier new,monospace;"><insert group name here></b><span style="font-family: courier new,monospace;">.run.lock # lock file name that RANCID creates while running</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">my $sleepTime = 60; # seconds to wait for lockfile to go away</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">my $sleepCount = 0; # how many times the script has looked for the lockfile, found it and waited</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
my $sleepMax = 10; # maximum number of times to sleep</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">while (-e $lockFile) {</span><br style="font-family: courier new,monospace;">
<div style="margin-left: 40px; font-family: courier new,monospace;"> if ($sleepCount >= $sleepMax) {<br> # add email notification here<br> die "wanted to run RANCID for host '$host' but couldn't ".<br>
"wait any longer for lockfile to go away. ".<br> "waited $sleepTime seconds $sleepCount times.";<br> }<br> $sleepCount++;<br> sleep $sleepTime;<br></div><span style="font-family: courier new,monospace;">}</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">system("rancid-run -r $host");</span><br><br>Dave<br>
<br><div class="gmail_quote">2010/3/8 Ivaylo Terziyski <span dir="ltr"><<a href="mailto:ivaylo.terziyski@btc-net.bg" target="_blank">ivaylo.terziyski@btc-net.bg</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div><font size="2" face="Arial">Hi everybody,</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">I am using SEC with RANCID to make configuration
updates on-demand.</font></div>
<div><font size="2" face="Arial">I have managed to configure SEC to scan TACACS+ log
and initiate 'rancid-run -r hostname' command.</font></div>
<div><font size="2" face="Arial">But if there are two users at the same time in
two different devices configuring I see in my logs:</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">hourly config diffs failed:
/tmp/.<group>.run.lock exists</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">and there are no diffs collected at
all.</font></div>
<div><font size="2" face="Arial">I will be appreciate some help resolving this
issue.</font></div></div>
<br>_______________________________________________<br>
Rancid-discuss mailing list<br>
<a href="mailto:Rancid-discuss@shrubbery.net" target="_blank">Rancid-discuss@shrubbery.net</a><br>
<a href="http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss" target="_blank">http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss</a><br></blockquote></div><br><br>