);
print "start installation\n";
+
+ # the install flag helps to determine when apt is done installing
+ my $install_flag_file = '/run/ceph-install-flag';
+ open(my $install_flag, '>', "${install_flag_file}") or
+ die "could not open Ceph installation flag - $!\n";
+ close $install_flag;
+
if (system(@apt_install, @ceph_packages) != 0) {
+ unlink $install_flag_file or
+ warn "Could not remove Ceph installation flag - $!";
die "apt failed during ceph installation ($?)\n";
}
'systemctl', 'try-reload-or-restart', 'pvedaemon.service', 'pveproxy.service'
]);
+ unlink $install_flag_file or
+ warn "Could not remove Ceph installation flag - $!";
+
return undef;
}});
$service = 'ceph_bin' if !defined($service);
- if (! -x $ceph_service->{$service}) {
+ # the flag file is checked as on a new installation, the binary gets
+ # extracted by dpkg before the installation is finished
+ if (! -x $ceph_service->{$service} || -f '/run/ceph-install-flag') {
die "binary not installed: $ceph_service->{$service}\n" if !$noerr;
return undef;
}