Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

Is there a possibility to create a hard link for an unix socket? I'm creating a jail and symbolic links won't work, so I'm looking for a solution, how to provide an unix socket inside chrootted environment.

The only idea I'm coming across is to use something like netcat but is there any reliable possibility?

share|improve this question

marked as duplicate by MichelZ, Rex, Ward, mdpc, Jenny D Apr 19 '14 at 16:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Linux at least would allow you to use a bind mount to make either a directory or alternatively a single file available at multiple places. Not tested, but in theory it should work...

  mount -t bind /var/MySQL.sock /chroot/var/MySQL.sock 
share|improve this answer
Bind works only for directories, so it doesn't solve the problem. – eRIZ Apr 17 '14 at 20:26
In the words of the man page One can also remount a single file (on a single file), and I have no problems accessing the MySQL daemon through the socket in the bind mount. But I don't have any chroot set up to test more. – HBruijn Apr 18 '14 at 12:57
Parameter list consist on two directories. I mean mounting a link directly, without separated directory. Could you provide your command line I can test against? Is this the above you cited? I tried to make it happen but this doesn't work. – eRIZ Apr 18 '14 at 17:56
You can also put the socket in a directory created for this purpose, and bind mount that. – Falcon Momot Apr 18 '14 at 18:43
@FalconMomot, I know but I want to solve problem. I'm aware of a workaround. [; – eRIZ Apr 18 '14 at 21:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.