Log NFS liveness checks

master
Vitaliy Filippov 2024-03-15 23:21:24 +03:00
parent f70da82317
commit 4f4b2dab80
1 changed files with 5 additions and 0 deletions

View File

@ -1056,6 +1056,7 @@ void nfs_proxy_t::mount_fs()
{
// Parent - loop and wait until child finishes
wanted_pid = pid;
exit_on_umount = false;
while (!child_finished)
{
ringloop->loop();
@ -1071,6 +1072,7 @@ void nfs_proxy_t::mount_fs()
else
fprintf(stderr, "Successfully mounted Vitastor pseudo-FS at %s\n", mountpoint.c_str());
finished = false;
exit_on_umount = true;
}
else
{
@ -1133,6 +1135,7 @@ void nfs_proxy_t::check_exit()
{
return;
}
fprintf(stderr, "All active NFS connections are closed, checking /proc/mounts\n");
std::string mountstr = read_file("/proc/mounts");
if (mountstr == "")
{
@ -1159,10 +1162,12 @@ void nfs_proxy_t::check_exit()
if (port_found && addr_found)
{
// OK, do not unmount
fprintf(stderr, "NFS mount to 127.0.0.1:%d still active, leaving server active\n", listening_port);
return;
}
}
}
fprintf(stderr, "NFS mount to 127.0.0.1:%d not found, exiting\n", listening_port);
// Not found, unmount
finished = true;
}