Bug 985 - [UPSTREAM] Sharing Unix Domain Sockets between VEs is impossible
[UPSTREAM] Sharing Unix Domain Sockets between VEs is impossible
Status: PATCHSENT
Product: OpenVZ
Classification: Unclassified
Component: kernel
mainstream
All All
: P2 normal
Assigned To: Pavel Emelyanov
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-27 17:51 EDT by Stefan Siegel
Modified: 2009-01-08 10:51 EST (History)
5 users (show)

See Also:


Attachments
0001-netns.patch (803 bytes, patch)
2008-09-24 08:19 EDT, Den Lunev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Siegel 2008-08-27 17:51:50 EDT
Creating a listening unix domain socket in a VE, hardlinking or bind-mounting it to another VE and connecting to it from within the other VE is impossible in the current devel version, tested with linux-image-2.6.24-openvz-24-004.1d1-686_004.1d1_i386.deb from download.openvz.org, and with linux-image-2.6.26-1-openvz-686_2.6.26-3_i386.deb from ftp.debian.org (Debian Sid).

The "Shared webhosting" article in the OpenVZ Wiki suggests to hardlink a MySQL socket from a MySQL VE other VEs which then can connect to MySQL using the shared socket. This is impossible in the current devel OpenVZ.

The problem is probably caused by the network namespaces change. Unix domain sockets are now part of the network namespace, so communication using unix domain sockets is only possible when both communicating processes are part of the same network namespace. While one may argue this is consistent, it is (at least for me) very surprising, and it is not backward compatible. There is no obvious way to work around this limitation (besides switching to network communication).

See also the related mail on users@openvz.org at http://openvz.org/pipermail/users/2008-August/002178.html
Comment 1 Alexey Lapitsky 2008-08-28 01:24:38 EDT
+1, 2.6.26 - same problem
Comment 2 Pavel Emelyanov 2008-09-09 10:00:08 EDT
Den :)

Also think whether we can fix this in the mainline, because a kludge you'll put... remove (!) from our kernel will not be acceptable "there".
Comment 3 Joshua Schmidlkofer 2008-09-16 20:08:06 EDT
I use this as well, and it's preventing one of my more serious servers from moving.  We brought this up in the testenv and found that communications failed.   Is there a patch?  I am using 2.6.24-ovz5 from git, checked out today.  
Comment 4 Pavel Emelyanov 2008-09-16 20:17:45 EDT
> Is there a patch?

not
yet
Comment 5 Den Lunev 2008-09-24 08:19:50 EDT
Created attachment 771 [details]
0001-netns.patch
Comment 6 Den Lunev 2008-09-24 08:20:24 EDT
the bug should remain opened until we'll decide how to handle the problem in the mainstream
Comment 8 Pavel Emelyanov 2009-01-08 10:51:23 EST
To mainstream