stop dbg init when not in debug mode.
authorDirk Koopman <djk@tobit.co.uk>
Fri, 10 Jul 2020 22:20:49 +0000 (23:20 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Fri, 10 Jul 2020 22:20:49 +0000 (23:20 +0100)
This fixes problems reported when running console.pl not as the
sysop user.

Changes
perl/console.pl

diff --git a/Changes b/Changes
index d9ddffa674c92918db791e0c1c04efd18a8d287c..b76642bff687c730e1ea103eee6de71340dd6cf9 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+10Jul20=======================================================================
+1. Fix console.pl permissions problem when running as another user not in 
+   debug mode. Console.pl WILL NOT WORK in debug mode unless it is running
+   as the sysop user.
 08Jul20=======================================================================
 1. "Finish" the RBN system :-)
 2. This includes enabling the coarse selection of spot modes using set/wantrbn
index 2a88f5b5db7aff99cd7dc3bf8d2ba86f6b3f5ef4..f7b0d5f4690e7b7edbefb6d3335bc540cd24d9c0 100755 (executable)
@@ -550,7 +550,11 @@ sub on_disconnect
 
 while (@ARGV && $ARGV[0] =~ /^-/) {
        my $arg = shift;
-       dbgadd('console'), $maxshist = 200 if $arg eq '-x';
+       if ($arg eq '-x') {
+               dbginit();
+               dbgadd('console');
+               $maxshist = 200;
+       }
 }
 
 $call = uc shift @ARGV if @ARGV;
@@ -569,8 +573,6 @@ if ($call eq $mycall) {
        exit(0);
 }
 
-dbginit();
-
 unless ($DB::VERSION) {
        $SIG{'INT'} = \&sig_term;
        $SIG{'TERM'} = \&sig_term;
@@ -592,7 +594,7 @@ $conn = IntMsg->connect($clusteraddr, $clusterport, rproc => \&rec_socket);
 $conn->{on_connect} = \&on_connect;
 $conn->{on_disconnect} = \&on_disconnect;
 
-my $timer = Mojo::IOLoop->recurring(1, sub {DXLog::flushall()});
+my $timer = Mojo::IOLoop->recurring(1, sub {DXLog::flushall()}) if $DXDebug::fp;
 
 $idle = Mojo::IOLoop->recurring(0.100 => \&idle_loop);
 Mojo::IOLoop->singleton->reactor->io(\*STDIN => sub {