diff --git a/Anvil/Tools.pm b/Anvil/Tools.pm index 6745afa2..0a37e938 100644 --- a/Anvil/Tools.pm +++ b/Anvil/Tools.pm @@ -1115,6 +1115,7 @@ sub _set_paths ifcfg => "/etc/sysconfig/network-scripts", journald => "/var/log/journal", libvirtd_definitions => "/etc/libvirt/qemu/", + opt_alteeve => "/opt/alteeve", pgsql => "/var/lib/pgsql/", resource_status => "/sys/kernel/debug/drbd/resources", scan_agents => "/usr/sbin/scancore-agents", diff --git a/tools/anvil-join-anvil b/tools/anvil-join-anvil index 17fa14ea..b6d9ad1b 100755 --- a/tools/anvil-join-anvil +++ b/tools/anvil-join-anvil @@ -298,7 +298,7 @@ sub configure_pacemaker my $both_online = 0; until($both_online) { - $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { 'path::configs::corosync.conf' => $anvil->data->{path}{configs}{'corosync.conf'}, }}); if (-e $anvil->data->{path}{configs}{'corosync.conf'}) diff --git a/tools/striker-get-screenshots b/tools/striker-get-screenshots index 0805428e..28b8bc42 100755 --- a/tools/striker-get-screenshots +++ b/tools/striker-get-screenshots @@ -42,6 +42,9 @@ if ($anvil->data->{switches}{'job-uuid'}) $anvil->data->{job}{progress} = 1; +# Make sure the directory we write screenshots to exists and has the proper ownership and mode. +check_screenshot_directory($anvil); + # Which subnodes are up? $anvil->Database->get_hosts(); $anvil->Database->get_dr_links(); @@ -178,6 +181,29 @@ $anvil->nice_exit({exit_code => 0}); # Functions # ############################################################################################################# +sub check_screenshot_directory +{ + my ($anvil) = @_; + + foreach my $directory ($anvil->data->{path}{directories}{opt_alteeve}, $anvil->data->{path}{directories}{screenshots}) + { + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { directory => $directory }}); + $anvil->Storage->change_owner({ + debug => 2, + path => $directory, + user => "striker-ui-api", + group => "striker-ui-api", + }); + $anvil->Storage->change_mode({ + debug => 2, + path => $directory, + mode => "0755", + }); + } + + return(0); +} + sub remove_old_screenshots { my ($anvil) = @_; @@ -411,6 +437,14 @@ sub get_screenshots 'format' => "jpeg", }, }); + + # Change the ownership + $anvil->Storage->change_owner({ + debug => 2, + path => $jpg_file, + user => "striker-ui-api", + group => "striker-ui-api", + }); } # Convert to png @@ -438,6 +472,14 @@ sub get_screenshots 'format' => "png", }, }); + + # Change the ownership + $anvil->Storage->change_owner({ + debug => 2, + path => $png_file, + user => "striker-ui-api", + group => "striker-ui-api", + }); } # Delete the original PPM file?