summaryrefslogtreecommitdiff
path: root/pingd
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2003-01-14 06:40:24 +0000
committerPeter Palfrader <peter@palfrader.org>2003-01-14 06:40:24 +0000
commitde0bd086333426c994a97addfcdfc7365c14fdf7 (patch)
treed3a8a50bb4a834ad6e2cc702cf34f4c4fcfd417b /pingd
parente00e832d440e065e66858155264d0e79cfd3df23 (diff)
Make logging configureable
redirect stdout/err to the logfile rather than "outfile" (nothing should ever get there); redirect stderr to /dev/null when calling Mixmaster
Diffstat (limited to 'pingd')
-rwxr-xr-xpingd8
1 files changed, 5 insertions, 3 deletions
diff --git a/pingd b/pingd
index 361d889..7f7f858 100755
--- a/pingd
+++ b/pingd
@@ -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;