Seems -d $dir is not really reliable on cluster file system (cache?).
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
package PVE::Cluster;
use strict;
-use POSIX;
+use POSIX qw(EEXIST);
use File::stat qw();
use Socket;
use Storable qw(dclone);
foreach my $dir (@required_dirs) {
if (! -d $dir) {
- mkdir($dir) || die "unable to create directory '$dir' - $!\n";
+ mkdir($dir) || $! == EEXIST || die "unable to create directory '$dir' - $!\n";
}
}
}
check_cfs_is_mounted();
- -d $authdir || mkdir $authdir || die "unable to create dir '$authdir' - $!\n";
+ mkdir $authdir || $! == EEXIST || die "unable to create dir '$authdir' - $!\n";
my $cmd = "openssl genrsa -out '$authprivkeyfn' 2048";
run_silent_cmd($cmd);