From 3d4d7abfe3233e7edb14fd37c254e4efbb5d7c0b Mon Sep 17 00:00:00 2001 From: digimer Date: Fri, 29 Sep 2023 13:01:58 -0400 Subject: [PATCH] Increased logging to debug server install failure. Signed-off-by: digimer --- tools/anvil-daemon | 4 ++-- tools/anvil-manage-files | 7 ++++++- tools/anvil-sync-shared | 5 +++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/anvil-daemon b/tools/anvil-daemon index 91281e32..23693880 100755 --- a/tools/anvil-daemon +++ b/tools/anvil-daemon @@ -952,7 +952,7 @@ sub check_incoming { my ($anvil) = @_; - my $shell_call = $anvil->data->{path}{exe}{'anvil-manage-files'}." --check"; + my $shell_call = $anvil->data->{path}{exe}{'anvil-manage-files'}." --check".$anvil->Log->switches; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { shell_call => $shell_call }}); my ($output, $return_code) = $anvil->System->call({ shell_call => $shell_call, @@ -1452,7 +1452,7 @@ sub prep_database { $anvil->Database->configure_pgsql({debug => 2}) # ### NOTE: This failed once, in case / until it happens again, we'll force log level 2 and secure logging. -# my $shell_call = $anvil->data->{path}{exe}{'striker-prep-database'}." -vv --log-secure"; +# my $shell_call = $anvil->data->{path}{exe}{'striker-prep-database'}$anvil->Log->switches; # $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { shell_call => $shell_call }}); # my ($database_output, $return_code) = $anvil->System->call({debug => 2, shell_call => $shell_call, source => $THIS_FILE, line => __LINE__ }); # $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { diff --git a/tools/anvil-manage-files b/tools/anvil-manage-files index 81cf7d69..db915c3f 100755 --- a/tools/anvil-manage-files +++ b/tools/anvil-manage-files @@ -53,8 +53,12 @@ if (($running_directory =~ /^\./) && ($ENV{PWD})) } my $anvil = Anvil::Tools->new(); - $anvil->Get->switches({list => ["add", "check", "delete", "download", "file", "is-script", "rename", "remove", "to"], man => $THIS_FILE}); + +### TODO: Remove this +$anvil->Log->level({set => 2}); +$anvil->Log->secure({set => 1}); + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => $anvil->data->{switches}}); # Connect or die @@ -1127,6 +1131,7 @@ AND { # Yup. ($file_uuid) = $anvil->Database->insert_or_update_files({ + debug => 2, file_uuid => $file_uuid, file_name => $file_name, file_directory => $file_directory, diff --git a/tools/anvil-sync-shared b/tools/anvil-sync-shared index db6cffa3..a0497555 100755 --- a/tools/anvil-sync-shared +++ b/tools/anvil-sync-shared @@ -34,6 +34,11 @@ my $anvil = Anvil::Tools->new(); # Read switches (target ([user@]host[:port]) and the file with the target's password. $anvil->data->{switches}{'job-uuid'} = ""; $anvil->Get->switches; + +### TODO: Remove this +$anvil->Log->level({set => 2}); +$anvil->Log->secure({set => 1}); + $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }}); # Connect to the database(s).