# IO (on /etc/pve) which can hang (uninterruptedly D state). That'd be
# no-good for ExecStartPre as it fails the whole service in this case
PVE::Tools::run_fork_with_timeout(30, sub {
+ PVE::Cluster::Setup::generate_local_files();
PVE::Cluster::Setup::updatecerts_and_ssh($param->@{qw(force silent)});
PVE::Cluster::prepare_observed_file_basedirs();
});
}
print "OK\n" if !$printqmsg;
+ generate_local_files();
updatecerts_and_ssh(1);
print "generated new node certificate, restart pveproxy and pvedaemon services\n";
print "successfully added node '$nodename' to cluster.\n";
}
+sub generate_local_files {
+ setup_rootsshconfig();
+ gen_pve_vzdump_symlink();
+}
+
sub updatecerts_and_ssh {
my ($force_new_cert, $silent) = @_;
my $p = sub { print "$_[0]\n" if !$silent };
- setup_rootsshconfig();
-
- gen_pve_vzdump_symlink();
-
if (!PVE::Cluster::check_cfs_quorum(1)) {
return undef if $silent;
die "no quorum - unable to update files\n";