Fixed a bug blocking most jobs from running.

* Also updated a bunch of 'apache' ownership calls to now use
  'striker-ui-api'.

Signed-off-by: digimer <mkelly@alteeve.ca>
main
digimer 11 months ago
parent d7aa7966dc
commit 92ed77e05b
  1. 4
      Anvil/Tools/Log.pm
  2. 4
      Anvil/Tools/System.pm
  3. 5
      tools/anvil-configure-host
  4. 26
      tools/anvil-daemon
  5. 8
      tools/anvil-download-file
  6. 4
      tools/anvil-parse-fence-agents
  7. 2
      tools/anvil-sync-shared
  8. 2
      tools/striker-manage-install-target
  9. 6
      tools/striker-prep-database

@ -491,7 +491,7 @@ sub entry
binmode($anvil->data->{HANDLE}{'log'}{main}, ':encoding(utf-8)');
print $THIS_FILE." ".__LINE__."; HANDLE::log::main: [".$anvil->data->{HANDLE}{'log'}{main}."]\n" if $test;
# Make sure it can be written to by apache.
# Make sure it can be written to by striker-ui-api.
$anvil->Storage->change_mode({test => $test, debug => $debug, path => $log_file, mode => "0666"});
}
@ -531,7 +531,7 @@ sub entry
$anvil->data->{HANDLE}{'log'}{alert} = $file_handle;
print $THIS_FILE." ".__LINE__."; HANDLE::log::alert: [".$anvil->data->{HANDLE}{'log'}{alert}."]\n" if $test;
# Make sure it can be written to by apache.
# Make sure it can be written to by striker-ui-api.
$anvil->Storage->change_mode({test => $test, debug => $debug, path => $log_file, mode => "0666"});
}

@ -3237,8 +3237,8 @@ sub generate_state_json
backup => 0,
file => $json_file,
body => $json,
group => "apache",
user => "apache",
group => "striker-ui-api",
user => "striker-ui-api",
mode => "0644",
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { error => $error }});

@ -153,7 +153,7 @@ sub do_reboot
return(0);
}
# This updates the passwords on the root user, admin user, database and apache user.
# This updates the passwords on the root user, admin user, database and striker-ui-api user.
sub update_passwords
{
my ($anvil) = @_;
@ -354,10 +354,11 @@ sub reconfigure_network
}
}
### NOTE: No longer needed, we don't use apache anymore.
# If we're a striker, check apache's config.
if ($type eq "striker")
{
$anvil->Striker->check_httpd_conf({debug => 2});
#$anvil->Striker->check_httpd_conf({debug => 2});
}
# Now configure the network.

@ -1123,7 +1123,7 @@ sub check_journald
return(0);
}
# This creates, as needed, the setuid wrappers used by apache to make certain system calls.
# This creates, as needed, the setuid wrappers used by striker-ui-api to make certain system calls.
sub check_setuid_wrappers
{
my ($anvil) = @_;
@ -1366,7 +1366,7 @@ AND
# Check the firewall needs to be updated.
check_firewall($anvil);
# If we're a striker, check apache
# If we're a striker, check striker-ui-api
my $host_type = $anvil->Get->host_type;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { host_type => $host_type }});
if ($host_type eq "striker")
@ -1538,10 +1538,6 @@ sub run_jobs
# changed on disk.
$anvil->data->{sys}{jobs_running} = 0;
# If we're not configured, we won't hold on starting jobs
my $configured = $anvil->System->check_if_configured;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { configured => $configured }});
# We'll also update the jobs.json file.
my $jobs_file = "{\"jobs\":[\n";
@ -1596,8 +1592,14 @@ sub run_jobs
's14:updated_seconds_ago' => $updated_seconds_ago,
}});
# If we're mapping, we'll only run 'anvil-configure-host' jobs on this host.
next if $job_command !~ /anvil-configure-host/;
# If we're not configured, we will only run the 'anvil-configure-host' job
my $configured = $anvil->System->check_if_configured;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { configured => $configured }});
if ((not $configured) && ($job_command !~ /anvil-configure-host/))
{
next;
}
# To minimize the chance of race conditions, any given command will be called only
# once at a time. If two jobs of the same command exist, only one will be called.
@ -1880,8 +1882,8 @@ sub run_jobs
overwrite => 1,
backup => 0,
mode => "0644",
user => "apache",
group => "apache",
user => "striker-ui-api",
group => "striker-ui-api",
});
return(0);
@ -1921,8 +1923,8 @@ sub check_files
{
my $failed = $anvil->Storage->make_directory({
directory => $directory,
group => "apache",
user => "apache",
group => "striker-ui-api",
user => "striker-ui-api",
mode => "0777",
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { failed => $failed }});

@ -222,8 +222,8 @@ sub download_file
debug => 2,
directory => $save_to,
mode => "0777",
user => "apache",
group => "apache",
user => "striker-ui-api",
group => "striker-ui-api",
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { failed => $failed }});
}
@ -233,8 +233,8 @@ sub download_file
debug => 2,
directory => $anvil->data->{path}{directories}{shared}{temp},
mode => "0777",
user => "apache",
group => "apache",
user => "striker-ui-api",
group => "striker-ui-api",
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { failed => $failed }});
}

@ -91,8 +91,8 @@ sub refresh_unified_metadata
backup => 0,
file => $anvil->data->{path}{data}{fences_unified_metadata},
body => $anvil->data->{fences}{unified_xml},
user => "apache",
group => "apache",
user => "striker-ui-api",
group => "striker-ui-api",
mode => "0666",
});
}

@ -483,7 +483,7 @@ sub process_incoming_file
$anvil->nice_exit({exit_code => 1});
}
# Change the owner as it'll be apache, which won't be a valid users on anvil members.
# Change the owner as it'll be striker-ui-api, which won't be a valid users on anvil members.
$anvil->Storage->change_owner({
debug => 2,
path => $target_file,

@ -709,7 +709,7 @@ sub setup_boot_environment
{
# Updated
$anvil->Storage->change_mode({path => $kickstart_file, mode => "0664"});
$anvil->Storage->change_owner({path => $kickstart_file, user => "apache", group => "apache" });
$anvil->Storage->change_owner({path => $kickstart_file, user => "striker-ui-api", group => "striker-ui-api" });
print $anvil->Words->string({key => "message_0097", variables => { file => $kickstart_file }})."\n";
update_progress($anvil, $progress, "message_0097,!!file!".$kickstart_file."!!");

@ -475,7 +475,7 @@ if ($local_uuid)
#####################################################################################################
### TODO: This will need to set the proper SELinux context.
# Apache run scripts can't call the system UUID, so we'll write it to a text file.
# striker-ui-api run scripts can't call the system UUID, so we'll write it to a text file.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "path::data::host_uuid" => $anvil->data->{path}{data}{host_uuid} }});
if (not -e $anvil->data->{path}{data}{host_uuid})
{
@ -483,8 +483,8 @@ if ($local_uuid)
debug => 3,
file => $anvil->data->{path}{data}{host_uuid},
body => $anvil->Get->host_uuid,
user => "apache",
group => "apache",
user => "striker-ui-api",
group => "striker-ui-api",
mode => "0666",
overwrite => 0,
});

Loading…
Cancel
Save