From 88e90e95c7b92268618c2ed62b7621b03c77fc26 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 16 Feb 2003 05:46:54 +0000 Subject: Check mixmaster binary on startup --- Echolot/Config.pm | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'Echolot/Config.pm') diff --git a/Echolot/Config.pm b/Echolot/Config.pm index f0f3c12..89b33ae 100644 --- a/Echolot/Config.pm +++ b/Echolot/Config.pm @@ -1,7 +1,7 @@ package Echolot::Config; # (c) 2002 Peter Palfrader -# $Id: Config.pm,v 1.51 2003/02/16 03:38:09 weasel Exp $ +# $Id: Config.pm,v 1.52 2003/02/16 05:46:54 weasel Exp $ # =pod @@ -102,9 +102,10 @@ sub init($) { chainpinger_interval => 5*60, # send out pings every 5 minutes chainping_every_nth_time => 810, # send out pings to the same chain every 810 calls, i.e. every 3 days chainping_period => 10*24*60*60, # 12 days - chainping_fudge => 0.7, # if less than 0.7 * rel1 * rel2 make it, the chain is really broken + chainping_fudge => 0.3, # if less than 0.3 * rel1 * rel2 make it, the chain is really broken chainping_grace => 1.5, # don't count pings sent no longer than 1.5 * (lat1 + lat2) ago chainping_update => 8*60*60, # chain stats should never be older than 8 hours + chainping_minsample => 3, # have at least sent 3 pings before judging any chain addresses_default_ttl => 5, # getkeyconf seconds (days) check_resurrection_ttl => 8, # check_resurrection seconds (weeks) @@ -273,6 +274,29 @@ sub init($) { }; }; +sub check_binaries() { + for my $bin (qw{mixmaster}) { + my $path = get()->{$bin}; + + if ($path =~ m#/#) { + Echolot::Log::warn ("$bin binary $path does not exist or is not executeable") + unless -x $path; + } else { + my $found = 0; + for my $pathelem (split /:/, $ENV{'PATH'}) { + $found = $pathelem, last + if -e $pathelem.'/'.$path; + }; + if ($found) { + Echolot::Log::warn ("$bin binary $found/$path is not executeable") + unless -x $found.'/'.$path; + } else { + Echolot::Log::warn ("$bin binary $path not found"); + }; + }; + }; +}; + sub get() { return $CONFIG; }; -- cgit v1.2.3