Code Monkey home page Code Monkey logo

Comments (11)

willscott avatar willscott commented on June 20, 2024

https://superuser.com/questions/1608873/does-a-unix-domain-socket-in-an-nfs-exported-fs-magically-work-across-hosts

I don't know if there's a way to communicate the internal kernel state about how the socket is supposed to work through the nfs protocol

from go-nfs.

DUOLabs333 avatar DUOLabs333 commented on June 20, 2024

Interestingly, if I try to start nc using the socket in the mount (so, nc -lU mount/test.sock instead of nc -lU test.sock), I get [ERROR] call to 0x11ae70 failed: Operation not supported. If the file already exists, Remove is called.

from go-nfs.

DUOLabs333 avatar DUOLabs333 commented on June 20, 2024

It's probably because onMknod has no support.

from go-nfs.

willscott avatar willscott commented on June 20, 2024

good catch. it should be reasonable straight forward to add that - i think the trick will be that the underlying billy fs interface also doesn't expose anything around this, so we'll need to add another optional interface for handlers to implement if they want to expose that on their filesystem implementation.

from go-nfs.

DUOLabs333 avatar DUOLabs333 commented on June 20, 2024

Yes --- we could just copy the syscall argument list --- path, mode, device number.

from go-nfs.

willscott avatar willscott commented on June 20, 2024

Do you have a sense of what the underlying system call should be when Mknod for a socket is sent over NFS?

  • the rfc indicates that Mknod can take a file type of NF3SOCK indicating creation of a socket. When that is requested, the only passed data is the sattr3 pipe_attributes; - which does not include a major or minor number.

from go-nfs.

willscott avatar willscott commented on June 20, 2024

I think i have a sketch of the expected backing behavior - working through it in https://github.com/willscott/go-nfs/tree/feat/mknod and will PR once ready.

The rfc is pretty thin on details on the expected semantics of a created socket in particular, but this may be close enough

from go-nfs.

willscott avatar willscott commented on June 20, 2024

the branch has a first pass at what seems like plausible for this code, and the osnfs example supporting mknod operations.

if you can point me to concrete repro steps for things not working ("on ubuntu, make an nfs mount, run these lines, get error") i'll be able to get to fixing potential bugs in here faster

from go-nfs.

DUOLabs333 avatar DUOLabs333 commented on June 20, 2024

Sorry, didn't see this till now: interestingly, you can't create just "hanging" sockets, but it looks like you figured something out.

There are two reproducers: one, create a mount exposing a local directory --- mount 127.0.0.1:dir mount. Run nc -lkU dir/test.sock. Try to do nc mount/test.sock. You should get a "Connection refused". However, this does not seem possible to solve.

Another reproducer: Do nc -lkU mount/test.sock. Then try to do nc mount/test.sock. You should get a Remove call and an "Operation not permitted". This is something that should be fixable.

from go-nfs.

willscott avatar willscott commented on June 20, 2024

Updated the branch linked above. I was able to create a socket and a fifo over the mount locally at least.

can you see if that gives you better behavior?

from go-nfs.

DUOLabs333 avatar DUOLabs333 commented on June 20, 2024

It does seem to work now --- the second reproducer now leads to the expected behavior (I can connect and send messages back and forth). #91 is still an issue though, so sockets wasn't the issue. Thanks!

from go-nfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.