* Cleaned up a lot of logging in anvil-daemon and tools it calls.

* Deleted anvil-jobs as it never ended up being used.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 4 years ago
parent 1ec03c9718
commit 1a520b03d5
  1. 4
      tools/anvil-change-password
  2. 2
      tools/anvil-check-memory
  3. 2
      tools/anvil-configure-host
  4. 5
      tools/anvil-daemon
  5. 2
      tools/anvil-download-file
  6. 2
      tools/anvil-file-details
  7. 36
      tools/anvil-jobs
  8. 4
      tools/anvil-join-anvil
  9. 2
      tools/anvil-manage-files
  10. 4
      tools/anvil-manage-firewall
  11. 4
      tools/anvil-manage-keys
  12. 2
      tools/anvil-manage-power
  13. 4
      tools/anvil-parse-fence-agents
  14. 4
      tools/anvil-provision-server
  15. 4
      tools/anvil-scan-network
  16. 5
      tools/anvil-sync-shared
  17. 5
      tools/anvil-update-states
  18. 3
      tools/anvil-update-system
  19. 4
      tools/scancore
  20. 4
      tools/striker-get-peer-data
  21. 4
      tools/striker-initialize-host
  22. 4
      tools/striker-manage-install-target
  23. 2
      tools/striker-manage-peers
  24. 2
      tools/striker-parse-os-list
  25. 4
      tools/striker-parse-oui
  26. 6
      tools/striker-prep-database
  27. 7
      tools/striker-purge-host
  28. 5
      tools/striker-scan-network

@ -30,7 +30,6 @@ $< = $>;
$( = $); $( = $);
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# Make sure we're running as 'root' # Make sure we're running as 'root'
# $< == real UID, $> == effective UID # $< == real UID, $> == effective UID
@ -41,6 +40,9 @@ if (($< != 0) && ($> != 0))
$anvil->nice_exit({exit_code => 1}); $anvil->nice_exit({exit_code => 1});
} }
$anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# Connect # Connect
$anvil->Database->connect(); $anvil->Database->connect();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0132"}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0132"});

@ -30,7 +30,7 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
# Turn off buffering so that the pinwheel will display while waiting for the SSH call(s) to complete. # Turn off buffering so that the pinwheel will display while waiting for the SSH call(s) to complete.
$| = 1; $| = 1;
my $anvil = Anvil::Tools->new({log_level => 2, log_secure => 1}); my $anvil = Anvil::Tools->new();
$anvil->data->{switches}{program} = ""; $anvil->data->{switches}{program} = "";
$anvil->Get->switches; $anvil->Get->switches;

@ -30,8 +30,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
$| = 1; $| = 1;
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 1});
# Read switches # Read switches
$anvil->Get->switches; $anvil->Get->switches;

@ -876,7 +876,7 @@ sub run_jobs
my $jobs_file = "{\"jobs\":[\n"; my $jobs_file = "{\"jobs\":[\n";
# Get a list of pending or incomplete jobs. # Get a list of pending or incomplete jobs.
my $return = $anvil->Database->get_jobs({ended_within => 300}); my $return = $anvil->Database->get_jobs({debug => 2, ended_within => 300});
my $count = @{$return}; my $count = @{$return};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
'return' => $return, 'return' => $return,
@ -897,7 +897,7 @@ sub run_jobs
my $job_status = $hash_ref->{job_status}; my $job_status = $hash_ref->{job_status};
my $started_seconds_ago = $job_picked_up_at ? (time - $job_picked_up_at) : 0; my $started_seconds_ago = $job_picked_up_at ? (time - $job_picked_up_at) : 0;
my $updated_seconds_ago = $job_updated ? (time - $job_updated) : 0; my $updated_seconds_ago = $job_updated ? (time - $job_updated) : 0;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
job_uuid => $job_uuid, job_uuid => $job_uuid,
job_command => $job_command, job_command => $job_command,
job_data => $job_data, job_data => $job_data,
@ -1030,7 +1030,6 @@ sub run_jobs
my $command = $job_command." --job-uuid ".$job_uuid; my $command = $job_command." --job-uuid ".$job_uuid;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, secure => 0, key => "log_0210", variables => { command => $command }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, secure => 0, key => "log_0210", variables => { command => $command }});
($anvil->data->{jobs}{handles}{$job_uuid}, my $return_code) = $anvil->System->call({ ($anvil->data->{jobs}{handles}{$job_uuid}, my $return_code) = $anvil->System->call({
debug => 3,
background => 1, background => 1,
stdout_file => "/tmp/anvil.job.".$job_uuid.".stdout", stdout_file => "/tmp/anvil.job.".$job_uuid.".stdout",
stderr_file => "/tmp/anvil.job.".$job_uuid.".stderr", stderr_file => "/tmp/anvil.job.".$job_uuid.".stderr",

@ -42,8 +42,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
} }
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 1});
$anvil->Database->connect; $anvil->Database->connect;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0132"}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0132"});

@ -28,8 +28,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
} }
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 1});
$anvil->data->{switches}{file} = ""; $anvil->data->{switches}{file} = "";
$anvil->data->{switches}{'with-md5sum'} = ""; $anvil->data->{switches}{'with-md5sum'} = "";

@ -1,36 +0,0 @@
#!/usr/bin/perl
#
# This program handles running jobs that might take some time to complete.
#
# Exit codes;
# 0 = Normal exit
# 1 = md5sum of this program changed. Exited to reload.
#
# TODO:
#
use strict;
use warnings;
use Anvil::Tools;
my $THIS_FILE = ($0 =~ /^.*\/(.*)$/)[0];
my $running_directory = ($0 =~ /^(.*?)\/$THIS_FILE$/)[0];
if (($running_directory =~ /^\./) && ($ENV{PWD}))
{
$running_directory =~ s/^\./$ENV{PWD}/;
}
# Turn off buffering so that the pinwheel will display while waiting for the SSH call(s) to complete.
$| = 1;
my $anvil = Anvil::Tools->new();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# I should have been passed a 'job_uuid'. Read in the details.
$anvil->nice_exit({exit_code => 0});
#############################################################################################################
# Functions #
#############################################################################################################

@ -33,13 +33,11 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
$| = 1; $| = 1;
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$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 }});
# Read switches (target ([user@]host[:port]) and the file with the target's password. If the password is # Read switches (target ([user@]host[:port]) and the file with the target's password. If the password is
# passed directly, it will be used. Otherwise, the password will be read from the database. # passed directly, it will be used. Otherwise, the password will be read from the database.
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->Database->connect(); $anvil->Database->connect();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, key => "log_0132"}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, key => "log_0132"});

@ -51,8 +51,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
} }
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 1});
$anvil->data->{switches}{'delete'} = ""; $anvil->data->{switches}{'delete'} = "";
$anvil->data->{switches}{download} = ""; $anvil->data->{switches}{download} = "";

@ -41,8 +41,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
} }
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 2});
# If the user has disabled auto-management of the firewall, exit. # If the user has disabled auto-management of the firewall, exit.
if (not $anvil->data->{sys}{manage}{firewall}) if (not $anvil->data->{sys}{manage}{firewall})
@ -50,7 +48,7 @@ if (not $anvil->data->{sys}{manage}{firewall})
# Do nothing. # Do nothing.
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});
} }
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# Read switches # Read switches
$anvil->data->{switches}{'y'} = ""; $anvil->data->{switches}{'y'} = "";

@ -31,14 +31,12 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
$| = 1; $| = 1;
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 1});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# Read switches (target ([user@]host[:port]) and the file with the target's password. If the password is # Read switches (target ([user@]host[:port]) and the file with the target's password. If the password is
# passed directly, it will be used. Otherwise, the password will be read from the database. # passed directly, it will be used. Otherwise, the password will be read from the database.
$anvil->data->{switches}{'job-uuid'} = ""; $anvil->data->{switches}{'job-uuid'} = "";
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
'switches::job-uuid' => $anvil->data->{switches}{'job-uuid'}, 'switches::job-uuid' => $anvil->data->{switches}{'job-uuid'},
}}); }});

@ -33,7 +33,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
} }
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# Read switches # Read switches
$anvil->data->{switches}{'poweroff'} = ""; $anvil->data->{switches}{'poweroff'} = "";
@ -45,6 +44,7 @@ $anvil->data->{switches}{'reboot-needed'} = "";
$anvil->data->{switches}{'job-uuid'} = ""; $anvil->data->{switches}{'job-uuid'} = "";
$anvil->data->{switches}{'no-delay'} = ""; $anvil->data->{switches}{'no-delay'} = "";
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
if ($anvil->data->{switches}{'power-off'}) if ($anvil->data->{switches}{'power-off'})
{ {

@ -24,12 +24,10 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
} }
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 0});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->data->{switches}{refresh} = 0; $anvil->data->{switches}{refresh} = 0;
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
"switches::refresh" => $anvil->data->{switches}{refresh}, "switches::refresh" => $anvil->data->{switches}{refresh},
}}); }});

@ -29,9 +29,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
$| = 1; $| = 1;
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 1});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# Read switches (target ([user@]host[:port]) and the file with the target's password. If the password is # Read switches (target ([user@]host[:port]) and the file with the target's password. If the password is
# passed directly, it will be used. Otherwise, the password will be read from the database. # passed directly, it will be used. Otherwise, the password will be read from the database.
@ -45,6 +42,7 @@ $anvil->data->{switches}{ram} = "";
$anvil->data->{switches}{'storage-group'} = ""; $anvil->data->{switches}{'storage-group'} = "";
$anvil->data->{switches}{'storage-size'} = ""; $anvil->data->{switches}{'storage-size'} = "";
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
'switches::anvil-uuid' => $anvil->data->{switches}{'anvil-uuid'}, 'switches::anvil-uuid' => $anvil->data->{switches}{'anvil-uuid'},
'switches::os' => $anvil->data->{switches}{os}, 'switches::os' => $anvil->data->{switches}{os},

@ -30,7 +30,9 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
$| = 1; $| = 1;
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
scan($anvil); scan($anvil);

@ -30,14 +30,11 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
$| = 1; $| = 1;
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 1});
# Read switches (target ([user@]host[:port]) and the file with the target's password. # Read switches (target ([user@]host[:port]) and the file with the target's password.
$anvil->data->{switches}{'job-uuid'} = ""; $anvil->data->{switches}{'job-uuid'} = "";
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }});
# Connect to the database(s). # Connect to the database(s).
$anvil->Database->connect; $anvil->Database->connect;

@ -18,10 +18,9 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
} }
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 0});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# If there's no DB (or cached data isn't recorded to the database yet), this will store those records. # If there's no DB (or cached data isn't recorded to the database yet), this will store those records.
$anvil->data->{cache}{new_file} = "# interface,timestamp,mac_address,speed,link_state,operational\n"; $anvil->data->{cache}{new_file} = "# interface,timestamp,mac_address,speed,link_state,operational\n";

@ -35,12 +35,11 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
} }
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# Read switches # Read switches
$anvil->data->{switches}{'job-uuid'} = ""; $anvil->data->{switches}{'job-uuid'} = "";
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# Log that we've started. # Log that we've started.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});

@ -39,7 +39,7 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
$running_directory =~ s/^\./$ENV{PWD}/; $running_directory =~ s/^\./$ENV{PWD}/;
} }
my $anvil = Anvil::Tools->new({log_level => 2, log_secure => 1}); my $anvil = Anvil::Tools->new();
# Make sure we're running as 'root' # Make sure we're running as 'root'
# $< == real UID, $> == effective UID # $< == real UID, $> == effective UID
@ -61,11 +61,11 @@ $anvil->data->{scancore} = {
}; };
$anvil->Storage->read_config(); $anvil->Storage->read_config();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "log_0115", variables => { program => $THIS_FILE }});
# Read switches # Read switches
$anvil->data->{switches}{'run-once'} = ""; $anvil->data->{switches}{'run-once'} = "";
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 2, key => "log_0115", variables => { program => $THIS_FILE }});
# Calculate my sum so that we can exit if it changes later. # Calculate my sum so that we can exit if it changes later.
$anvil->Storage->record_md5sums(); $anvil->Storage->record_md5sums();

@ -27,9 +27,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
$| = 1; $| = 1;
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 1});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# Read switches (target ([user@]host[:port]) and the file with the target's password. If the password is # Read switches (target ([user@]host[:port]) and the file with the target's password. If the password is
# passed directly, it will be used. Otherwise, the password will be read from the database. # passed directly, it will be used. Otherwise, the password will be read from the database.
@ -37,6 +34,7 @@ $anvil->data->{switches}{target} = "";
$anvil->data->{switches}{'state-uuid'} = ""; $anvil->data->{switches}{'state-uuid'} = "";
$anvil->data->{switches}{password} = ""; $anvil->data->{switches}{password} = "";
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
'switches::target' => $anvil->data->{switches}{target}, 'switches::target' => $anvil->data->{switches}{target},
'switches::state-uuid' => $anvil->data->{switches}{'state-uuid'}, 'switches::state-uuid' => $anvil->data->{switches}{'state-uuid'},

@ -29,13 +29,11 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
$| = 1; $| = 1;
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$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 }});
# Read switches (target ([user@]host[:port]) and the file with the target's password. # Read switches (target ([user@]host[:port]) and the file with the target's password.
$anvil->data->{switches}{'job-uuid'} = ""; $anvil->data->{switches}{'job-uuid'} = "";
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
'switches::job-uuid' => $anvil->data->{switches}{'job-uuid'}, 'switches::job-uuid' => $anvil->data->{switches}{'job-uuid'},
}}); }});

@ -65,9 +65,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
} }
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 1});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# Read switches # Read switches
$anvil->data->{switches}{check} = 0; $anvil->data->{switches}{check} = 0;
@ -79,6 +76,7 @@ $anvil->data->{switches}{'no-refresh'} = 0;
$anvil->data->{switches}{refresh} = 0; $anvil->data->{switches}{refresh} = 0;
$anvil->data->{switches}{status} = ""; $anvil->data->{switches}{status} = "";
$anvil->Get->switches(); $anvil->Get->switches();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
'switches::check' => $anvil->data->{switches}{check}, 'switches::check' => $anvil->data->{switches}{check},
'switches::disable' => $anvil->data->{switches}{disable}, 'switches::disable' => $anvil->data->{switches}{disable},

@ -39,7 +39,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
$| = 1; $| = 1;
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# Read switches # Read switches
$anvil->data->{switches}{list} = ""; $anvil->data->{switches}{list} = "";
@ -52,6 +51,7 @@ $anvil->data->{switches}{'port'} = 5432;
$anvil->data->{switches}{'password-file'} = ""; $anvil->data->{switches}{'password-file'} = "";
$anvil->data->{switches}{'ping'} = 0; $anvil->data->{switches}{'ping'} = 0;
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# Make sure we're running as 'root' # Make sure we're running as 'root'
# $< == real UID, $> == effective UID # $< == real UID, $> == effective UID

@ -20,10 +20,10 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
$| = 1; $| = 1;
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }});
# Read switches (target ([user@]host[:port]) and the file with the target's password. # Read switches (target ([user@]host[:port]) and the file with the target's password.
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }});
my $words_file = $anvil->data->{path}{words}{'words.xml'}; my $words_file = $anvil->data->{path}{words}{'words.xml'};
my $language = $anvil->Words->language; my $language = $anvil->Words->language;

@ -22,9 +22,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
} }
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 0});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->Database->connect; $anvil->Database->connect;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0132"}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0132"});
@ -38,6 +35,7 @@ if (not $anvil->data->{sys}{database}{connections})
$anvil->data->{switches}{'job-uuid'} = ""; $anvil->data->{switches}{'job-uuid'} = "";
$anvil->data->{switches}{force} = ""; $anvil->data->{switches}{force} = "";
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
"switches::job-uuid" => $anvil->data->{switches}{'job-uuid'}, "switches::job-uuid" => $anvil->data->{switches}{'job-uuid'},
"switches::force" => $anvil->data->{switches}{force}, "switches::force" => $anvil->data->{switches}{force},

@ -27,9 +27,9 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
$| = 1; $| = 1;
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 1}); $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
my $local_uuid = $anvil->Database->get_local_uuid(); my $local_uuid = $anvil->Database->get_local_uuid();
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { local_uuid => $local_uuid }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { local_uuid => $local_uuid }});

@ -27,9 +27,10 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
# Turn off buffering so that the pinwheel will display while waiting for the SSH call(s) to complete. # Turn off buffering so that the pinwheel will display while waiting for the SSH call(s) to complete.
$| = 1; $| = 1;
my $anvil = Anvil::Tools->new({debug => 2}); my $anvil = Anvil::Tools->new();
$anvil->Log->secure({set => 1});
$anvil->Log->level({set => 2}); $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->Database->connect({debug => 3}); $anvil->Database->connect({debug => 3});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0132"}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0132"});

@ -30,9 +30,6 @@ if (($running_directory =~ /^\./) && ($ENV{PWD}))
} }
my $anvil = Anvil::Tools->new(); my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 0});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
# Make sure we're running as 'root' # Make sure we're running as 'root'
# $< == real UID, $> == effective UID # $< == real UID, $> == effective UID
@ -57,12 +54,14 @@ $anvil->data->{switches}{network} = "";
$anvil->data->{switches}{'job-uuid'} = ""; $anvil->data->{switches}{'job-uuid'} = "";
$anvil->data->{switches}{force} = ""; $anvil->data->{switches}{force} = "";
$anvil->Get->switches; $anvil->Get->switches;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, secure => 0, key => "log_0115", variables => { program => $THIS_FILE }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
"switches::network" => $anvil->data->{switches}{network}, "switches::network" => $anvil->data->{switches}{network},
"switches::job-uuid" => $anvil->data->{switches}{'job-uuid'}, "switches::job-uuid" => $anvil->data->{switches}{'job-uuid'},
"switches::force" => $anvil->data->{switches}{force}, "switches::force" => $anvil->data->{switches}{force},
}}); }});
update_progress($anvil, 0, "clear"); update_progress($anvil, 0, "clear");
update_progress($anvil, 1, "log_0239,!!job-uuid!".$anvil->data->{switches}{'job-uuid'}."!!"); update_progress($anvil, 1, "log_0239,!!job-uuid!".$anvil->data->{switches}{'job-uuid'}."!!");
$anvil->data->{progress} = 1; $anvil->data->{progress} = 1;

Loading…
Cancel
Save