Wrap the -d test with run_or_get_killed sub this test
can make pvestatd hang on I/O wait when a nfsd process is stopped
This might help with other file based storages, for instance
directory storages on unplugged USB devices.
die "storage definintion has no path\n" if !$path;
- die "unable to activate storage '$storeid' - " .
- "directory '$path' does not exist\n" if ! -d $path;
+ # this path test may hang indefinitely on unresponsive mounts
+ my $timeout = 2;
+ if (! PVE::Tools::run_fork_with_timeout($timeout, sub {-d $path})) {
+ die "unable to activate storage '$storeid' - " .
+ "directory '$path' does not exist or is unreachable\n";
+ }
+
return if defined($scfg->{mkdir}) && !$scfg->{mkdir};