diff options
-rw-r--r-- | Echolot/Commands.pm | 8 | ||||
-rw-r--r-- | Echolot/Config.pm | 4 | ||||
-rw-r--r-- | NEWS | 3 | ||||
-rwxr-xr-x | pingd | 77 |
4 files changed, 58 insertions, 34 deletions
diff --git a/Echolot/Commands.pm b/Echolot/Commands.pm index d5ef445..41b9804 100644 --- a/Echolot/Commands.pm +++ b/Echolot/Commands.pm @@ -1,7 +1,7 @@ package Echolot::Commands; # (c) 2002 Peter Palfrader <peter@palfrader.org> -# $Id: Commands.pm,v 1.5 2002/07/03 11:08:21 weasel Exp $ +# $Id: Commands.pm,v 1.6 2002/07/13 23:37:55 weasel Exp $ # =pod @@ -69,6 +69,12 @@ sub processCommands($) { Echolot::Globals::get()->{'storage'}->set_stuff(@args); } elsif ($command eq 'getkeyconf') { Echolot::Globals::get()->{'scheduler'}->schedule('getkeyconf', time() ); + } elsif ($command eq 'buildstats') { + Echolot::Globals::get()->{'scheduler'}->schedule('buildstats', time() ); + } elsif ($command eq 'buildkeys') { + Echolot::Globals::get()->{'scheduler'}->schedule('buildkeys', time() ); + } elsif ($command eq 'buildthesaurus') { + Echolot::Globals::get()->{'scheduler'}->schedule('buildthesaurus', time() ); } elsif ($command eq 'delete') { Echolot::Globals::get()->{'storage'}->delete_remailer(@args); } elsif ($command eq 'setremailercaps') { diff --git a/Echolot/Config.pm b/Echolot/Config.pm index 06460f5..42af3e0 100644 --- a/Echolot/Config.pm +++ b/Echolot/Config.pm @@ -1,7 +1,7 @@ package Echolot::Config; # (c) 2002 Peter Palfrader <peter@palfrader.org> -# $Id: Config.pm,v 1.24 2002/07/13 20:35:50 weasel Exp $ +# $Id: Config.pm,v 1.25 2002/07/13 23:37:55 weasel Exp $ # =pod @@ -78,11 +78,11 @@ sub init($) { ping_every_nth_time => 48, # send out pings to the same remailer every 48 calls, i.e. every 4 hours buildstats => 5*60, # build statistics every 5 minutes buildkeys => 8*60*60, # build keyring every 8 hours + buildthesaurus => 60*60, # hourly commitprospectives => 8*60*60, # commit prospective addresses every 8 hours expire => 24*60*60, # daily getkeyconf => 24*60*60, # daily check_resurrection => 7*24*60*60, # weekly - build_thesaurus => 60*60, # hourly resultdir => 'results', thesaurusdir => 'results/thesaurus', @@ -1,3 +1,6 @@ +Changes in version + * Added commands buildstats buildkeys and buildthesaurus + Changes in version 2.0beta13 - 2002-07-12 * Have correct title tags and some layout changes in the HTML templates * Encode HTML Entities in HTML Stats @@ -3,7 +3,7 @@ $| = 1; # (c) 2002 Peter Palfrader <peter@palfrader.org> -# $Id: pingd,v 1.39 2002/07/13 21:23:02 weasel Exp $ +# $Id: pingd,v 1.40 2002/07/13 23:37:55 weasel Exp $ # =pod @@ -34,6 +34,12 @@ pingd - echolot ping daemon =item B<pingd> B<getkeyconf> +=item B<pingd> B<buildstats> + +=item B<pingd> B<buildkeys> + +=item B<pingd> B<buildthesaurus> + =item B<pingd> B<dumpconf> =back @@ -124,6 +130,18 @@ the next valid remailer-conf reply by the remailer. Send a command to immediatly request keys and configuration from remailers. +=item B<buildstats> + +Send a command to immediatly rebuild stats. + +=item B<buildkeys> + +Send a command to immediatly rebuild the keyrings. + +=item B<buildthesaurus> + +Send a command to immediatly rebuild the Thesaurus. + =item B<dumpconf> Dumps the current configuration to standard output. @@ -149,7 +167,8 @@ Print version number and exit sucessfully. =item --nohup Usefull only with the B<add>, B<set>, B<setremailercaps>, -B<deleteremailercaps> or B<getkeyconf> command. +B<deleteremailercaps>, B<getkeyconf>, B<buildstats>, B<buildkeys>, +or B<buildthesaurus> command. Don't send a HUP signal to the daemon which instructs it to process the commands after adding the command to the task list. @@ -369,7 +388,7 @@ sub daemon_run($) { $scheduler->add('ping' , Echolot::Config::get()->{'pinger_interval'} , 0, \&Echolot::Pinger::send_pings ); $scheduler->add('buildstats' , Echolot::Config::get()->{'buildstats'} , 0, \&Echolot::Stats::build_stats ); $scheduler->add('buildkeys' , Echolot::Config::get()->{'buildkeys'} , 0, \&Echolot::Stats::build_keys ); - $scheduler->add('buildthesaurus' , Echolot::Config::get()->{'build_thesaurus'} , 0, \&Echolot::Thesaurus::build_thesaurus ); + $scheduler->add('buildthesaurus' , Echolot::Config::get()->{'buildthesaurus'} , 0, \&Echolot::Thesaurus::build_thesaurus ); $scheduler->add('commitprospectives' , Echolot::Config::get()->{'commitprospectives'} , 0, \&commit_prospective_address ); $scheduler->add('expire' , Echolot::Config::get()->{'expire'} , 0, \&expire ); @@ -444,7 +463,14 @@ sub make_dirs() { }; }; - +sub hup_if_wanted($) { + my ($nohup) = @_; + if (!$nohup && pid_exists()) { + daemon_hup() + } else { + print "Don't forget to run $PROGRAM_NAME process.\n"; + }; +}; @@ -492,39 +518,28 @@ Echolot::Globals::init(); if ($COMMAND eq 'add' || $COMMAND eq 'delete') { command_adddelete($COMMAND, @ARGV); - if (!$params->{'nohup'} && pid_exists()) { - daemon_hup() - } else { - print "Don't forget to run $PROGRAM_NAME process.\n"; - }; + hup_if_wanted($params->{'nohup'}); } elsif ($COMMAND eq 'set') { command_set(@ARGV); - if (!$params->{'nohup'} && pid_exists()) { - daemon_hup() - } else { - print "Don't forget to run $PROGRAM_NAME process.\n"; - }; -} elsif ($COMMAND eq 'setremailercaps') { - command_setremailercaps(@ARGV); - if (!$params->{'nohup'} && pid_exists()) { - daemon_hup() - } else { - print "Don't forget to run $PROGRAM_NAME process.\n"; - }; + hup_if_wanted($params->{'nohup'}); } elsif ($COMMAND eq 'deleteremailercaps') { command_deleteremailercaps(@ARGV); - if (!$params->{'nohup'} && pid_exists()) { - daemon_hup() - } else { - print "Don't forget to run $PROGRAM_NAME process.\n"; - }; + hup_if_wanted($params->{'nohup'}); +} elsif ($COMMAND eq 'setremailercaps') { + command_setremailercaps(@ARGV); + hup_if_wanted($params->{'nohup'}); } elsif ($COMMAND eq 'getkeyconf') { Echolot::Commands::addCommand("getkeyconf"); - if (!$params->{'nohup'} && pid_exists()) { - daemon_hup() - } else { - print "Don't forget to run $PROGRAM_NAME process.\n"; - }; + hup_if_wanted($params->{'nohup'}); +} elsif ($COMMAND eq 'buildstats') { + Echolot::Commands::addCommand("buildstats"); + hup_if_wanted($params->{'nohup'}); +} elsif ($COMMAND eq 'buildkeys') { + Echolot::Commands::addCommand("buildkeys"); + hup_if_wanted($params->{'nohup'}); +} elsif ($COMMAND eq 'buildthesaurus') { + Echolot::Commands::addCommand("buildthesaurus"); + hup_if_wanted($params->{'nohup'}); } elsif ($COMMAND eq 'process') { daemon_hup(); } elsif ($COMMAND eq 'stop') { |