[rancid] Re: rancid with sec issue
David Clement
dclement at clickability.com
Tue Mar 9 01:20:32 UTC 2010
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:
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:
#!/usr/bin/perl
my ($host) = shift;
my $lockFile = '/tmp/*<insert group name here>*.run.lock # lock file name
that RANCID creates while running
my $sleepTime = 60; # seconds to wait for lockfile to go away
my $sleepCount = 0; # how many times the script has looked for the
lockfile, found it and waited
my $sleepMax = 10; # maximum number of times to sleep
while (-e $lockFile) {
if ($sleepCount >= $sleepMax) {
# add email notification here
die "wanted to run RANCID for host '$host' but couldn't ".
"wait any longer for lockfile to go away. ".
"waited $sleepTime seconds $sleepCount times.";
}
$sleepCount++;
sleep $sleepTime;
}
system("rancid-run -r $host");
Dave
2010/3/8 Ivaylo Terziyski <ivaylo.terziyski at btc-net.bg>
> Hi everybody,
>
> I am using SEC with RANCID to make configuration updates on-demand.
> I have managed to configure SEC to scan TACACS+ log and initiate
> 'rancid-run -r hostname' command.
> But if there are two users at the same time in two different devices
> configuring I see in my logs:
>
> hourly config diffs failed: /tmp/.<group>.run.lock exists
>
> and there are no diffs collected at all.
> I will be appreciate some help resolving this issue.
>
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20100308/cbd43f30/attachment.html
More information about the Rancid-discuss
mailing list