* Updated anvil-daemon to set the mode of /mnt/shared/* to 0777 during creation and to check that that mode is set for existing sub-directories. This resolves issue #443.

* Cleaned up anvil-manage-dr.8 hyphen escapes.

Signed-off-by: digimer <mkelly@alteeve.ca>
main
digimer 1 year ago
parent f23768ac32
commit d255adc7b4
  1. 2
      Anvil/Tools/Storage.pm
  2. 6
      man/anvil-manage-dr.8
  3. 23
      tools/anvil-daemon

@ -416,7 +416,7 @@ sub change_mode
return('!!error!!');
}
my $shell_call = $anvil->data->{path}{exe}{'chmod'}." $mode $path";
my $shell_call = $anvil->data->{path}{exe}{'chmod'}." ".$mode." ".$path;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0011", variables => { shell_call => $shell_call }});
if ($anvil->Network->is_local({host => $target}))
{

@ -14,7 +14,7 @@ This tool is used to manage the protection of servers on DR hosts.
\-?, \-h, \fB\-\-help\fR
Show this man page.
.TP
\fB\-\-log-secure\fR
\fB\-\-log\-secure\fR
When logging, record sensitive data, like passwords.
.TP
\-v, \-vv, \-vvv
@ -27,10 +27,10 @@ Connect a server already on DR to it's DR copy, update the data there if needed
\fB\-\-disconnect\fR
Disconnect a server from the DR image. This will end streaming replication.
.TP
\fB\-\-dr-host\fR
\fB\-\-dr\-host\fR
This is the host name or host UUID for the DR to use. It is optional if only one DR host is connected to this Anvil! node, but required if two or more are defined.
.TP
\fB\-\-license-file\fR
\fB\-\-license\-file\fR
This is the path to the license file, needed when setting up "long-throw" DR for the first time.
.TP
\fB\-\-link\fR

@ -1896,17 +1896,34 @@ sub check_files
foreach my $target (sort {$a cmp $b} keys %{$anvil->data->{path}{directories}{shared}})
{
my $directory = $anvil->data->{path}{directories}{shared}{$target};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
target => $target,
directory => $directory,
}});
if (not -e $anvil->data->{path}{directories}{shared}{$target})
if (-e $directory)
{
# Make sure the permissions are correct.
$anvil->Storage->get_file_stats({file_path => $directory});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
"file_stat::${directory}::unix_mode" => $anvil->data->{file_stat}{$directory}{unix_mode},
}});
if ($anvil->data->{file_stat}{$directory}{unix_mode} !~ /0777$/)
{
$anvil->Storage->change_mode({
debug => 2,
path => $directory,
mode => "0777"
});
}
}
elsif (not -e $anvil->data->{path}{directories}{shared}{$target})
{
my $failed = $anvil->Storage->make_directory({
directory => $directory,
group => "apache",
user => "apache",
mode => "0775",
mode => "0777",
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { failed => $failed }});
if ($failed)

Loading…
Cancel
Save