xetdata / nfsserve

A Rust NFS Server implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Confuse about a todo item

willser opened this issue · comments

commented

Hello team,
You done a great job!And I think there are still something I can do as a new.I check the list in TODO and Seeking Contributors .One of them make me confuse which is Maybe pull in the mount command from [xet-core]....Does It mean printing those command after NFSserve start?
I make a issue tring to figure it out avoid do something unnecessory. 👀

Thanks!

Briefly, there is a mechanism implemented in gitxet-core which is worth extracting and copying.
Basically the goal is to allow a program that is using this crate to:

  • re-launch itself with the nfs server started and daemonized
  • wait for the nfs server to start up
  • execute the system mount command to connect to the nfs server

This makes it really simple to perform a mount.

A more detailed description of the implementation is that the user calls:
(https://github.com/xetdata/xet-core/blob/main/rust/gitxetcore/src/command/mount.rs)

git-xet mount [args]

This this internally exec and daemonizes and waits for a signal SIGUSR1.

git-xet mount-curdir [args] -s [parent-pid]

The daemon, sends SIGUSR1 to the parent pid once the nfs server is started.

The parent upon receipt of SIGUSR1 then continues to find the system mount program and runs it (https://github.com/xetdata/xet-core/blob/main/rust/gitxetcore/src/xetmnt/mod.rs) with a bunch of error handling.

If the mount is successful, we return success. The server I think will also self-terminate after a timeout.

commented

Hi @ylow , thank you for your reply, and I am very grateful. I am sorry for replying so late; I have been occupied with other things. I have read the code you mentioned in xet-core, but now I am facing a bigger confusion. Initially,I thought this feature was meant to make it easier for users regardless of the client they use. So, I asked if it simply adds some command tips after the server starts. However, your comment doesn't seem to imply that. Do you suggest creating a demo that would help other developers in developing their own clients more easily?

Fyi I made a version of this here: https://github.com/n0-computer/iroh/blob/feat-runtime/iroh/src/commands/mount_runner.rs was pretty straightforward.

In general I think this should be added as helpers to the core library, given that almost all users will need sth like this to automate the mounting process.