diff options
-rw-r--r-- | Echolot/Config.pm | 9 | ||||
-rw-r--r-- | Echolot/Pinger/Mix.pm | 4 | ||||
-rw-r--r-- | doc/pingd.conf.pod | 23 | ||||
-rwxr-xr-x | pingd | 8 | ||||
-rw-r--r-- | pingd.conf.sample | 5 |
5 files changed, 42 insertions, 7 deletions
diff --git a/Echolot/Config.pm b/Echolot/Config.pm index 090d55b..385d1d4 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.45 2003/01/14 05:25:35 weasel Exp $ +# $Id: Config.pm,v 1.46 2003/01/14 06:40:24 weasel Exp $ # =pod @@ -138,6 +138,11 @@ sub init($) { } }, + # logging + logfile => 'pingd.log', + loglevel => 'info', + + # ping types do_pings => { 'cpunk-dsa' => 1, @@ -180,7 +185,7 @@ sub init($) { " not a remailer\n". "\n". "If you want to talk to a human please mail <TMPL_VAR NAME=\"operator_address\">.\n", - + homedir => undef, my_localpart => undef, my_domain => undef, diff --git a/Echolot/Pinger/Mix.pm b/Echolot/Pinger/Mix.pm index b0cf783..6e1072d 100644 --- a/Echolot/Pinger/Mix.pm +++ b/Echolot/Pinger/Mix.pm @@ -1,7 +1,7 @@ package Echolot::Pinger::Mix; # (c) 2002 Peter Palfrader <peter@palfrader.org> -# $Id: Mix.pm,v 1.11 2003/01/14 06:04:37 weasel Exp $ +# $Id: Mix.pm,v 1.12 2003/01/14 06:40:24 weasel Exp $ # =pod @@ -67,7 +67,7 @@ sub ping($$$$) { return 0; $ENV{'MIXPATH'} = Echolot::Config::get()->{'mixhome'}; - open(MIX, "|".Echolot::Config::get()->{'mixmaster'}." -m -S -l $chaincomma") or + open(MIX, "|".Echolot::Config::get()->{'mixmaster'}." -m -S -l $chaincomma 2>/dev/null") or Echolot::Log::warn("Cannot exec mixpinger: $!."), return 0; print MIX "To: $to\n\n$body\n"; diff --git a/doc/pingd.conf.pod b/doc/pingd.conf.pod index 2ba3d0f..a012b4f 100644 --- a/doc/pingd.conf.pod +++ b/doc/pingd.conf.pod @@ -514,6 +514,29 @@ generated stats. Otherwise its content is copied in verbatim. =back +=head2 LOGGING + +=over + +=item B<logfile> + +File to write logs to. This file is reopened on SIGHUP. + + Default: 'logfile' => 'pingd.log', + Example: 'logfile' => '/var/log/echolot/pingd.log', + +=item B<loglevel> + +Minimum severity of messages to include in log file. Possible values are +B<debug>, B<info>, B<notice>, B<warning>, B<error>, B<critical>, B<alert>, and +B<emergency>. + + Default: 'loglevel' => 'info', + Example: 'loglevel' => 'debug', + +=back + + =head2 MISCELLANEOUS =over @@ -3,7 +3,7 @@ $| = 1; # (c) 2002 Peter Palfrader <peter@palfrader.org> -# $Id: pingd,v 1.88 2003/01/14 06:27:41 weasel Exp $ +# $Id: pingd,v 1.89 2003/01/14 06:40:24 weasel Exp $ # =pod @@ -307,7 +307,8 @@ sub setSigHandlers() { if ($redirected_stdio) { close STDOUT; close STDERR; - open (STDOUT, ">>output") or die ("Cannot open 'output' as STDOUT\n"); + my $logfile = Echolot::Config::get()->{'logfile'}; + open (STDOUT, ">>$logfile") or die ("Cannot open '$logfile' as STDOUT\n"); open (STDERR, ">&STDOUT") or die ("Cannot dup STDOUT as STDERR\n"); }; Echolot::Log::reopen(); @@ -666,7 +667,8 @@ if ($COMMAND eq 'add' || $COMMAND eq 'delete') { exit(0) if (fork()); POSIX::setsid(); exit(0) if (fork()); - open (STDOUT, ">>output") or die ("Cannot open 'output' as STDOUT\n"); + my $logfile = Echolot::Config::get()->{'logfile'}; + open (STDOUT, ">>$logfile") or die ("Cannot open '$logfile' as STDOUT\n"); open (STDERR, ">&STDOUT") or die ("Cannot dup STDOUT as STDERR\n"); open (STDIN , "</dev/null") or die ("Cannot open /dev/null as STDIN\n"); $redirected_stdio = 1; diff --git a/pingd.conf.sample b/pingd.conf.sample index b993b67..77cc781 100644 --- a/pingd.conf.sample +++ b/pingd.conf.sample @@ -42,5 +42,10 @@ $CONFIG = { # standard format it is nice to read for a human eye. 'combined_list' => 0, + # Log file and level (valid levels are debug, info, notice, warning, error, + # critical, alert, emergency) + #'logfile' => 'pingd.log', + #'loglevel' => 'info', + }; 1; |