require Exporter;
@ISA = qw(Exporter);
-@EXPORT = qw(dbg dbgadd dbgsub dbglist isdbg);
-@EXPORT_OK = qw(dbg dbgadd dbgsub dbglist isdbg);
+@EXPORT = qw(dbg dbgadd dbgsub dbglist isdbg dbgclose);
+@EXPORT_OK = qw(dbg dbgadd dbgsub dbglist isdbg dbgclose);
use strict;
use vars qw(%dbglevel $fp);
};
}
+sub dbgclose
+{
+ $SIG{__DIE__} = $SIG{__WARN__} = 'DEFAULT';
+ $fp->close();
+}
+
sub dbg
{
my $l = shift;
sub DESTROY # catch undefs and do what is required further down the tree
{
my $self = shift;
- DXDebug::dbg("dxlog", "closing $self->{fn}\n");
+# DXDebug::dbg("dxlog", "closing $self->{fn}\n");
undef $self->{fh} if defined $self->{fh};
}
1;
-#!/usr/bin/perl
+#!/usr/bin/perl -w
#
# A thing that implements dxcluster 'protocol'
#
dbg('connect', "killing $pid");
kill(9, $pid);
}
+ dbgclose();
sleep(1);
exit(0);
}
DXUser::finish();
dbg('chan', "DXSpider version $version ended");
Log('cluster', "DXSpider V$version stopped");
+ dbgclose();
unlink $lockfn;
exit(0);
}